summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-09-18 15:07:45 +1000
committerNeilBrown <neilb@suse.de>2008-09-18 15:07:45 +1000
commit9b2a22d319a85c1571c776e7059d9ca4bf1a0f0a (patch)
tree87d0bf71d1c619a567d9a2ce22993edffc260a8f /super1.c
parent7b187ed7e95e81f3f623a718c7aabaa081f79e90 (diff)
downloadmdadm-9b2a22d319a85c1571c776e7059d9ca4bf1a0f0a.tar.gz
mdadm-9b2a22d319a85c1571c776e7059d9ca4bf1a0f0a.tar.xz
mdadm-9b2a22d319a85c1571c776e7059d9ca4bf1a0f0a.zip
Ignore leading zeros in version number information.
--detail sometimes generates leading zero which are just noise.
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/super1.c b/super1.c
index 2e3ef53..e71b969 100644
--- a/super1.c
+++ b/super1.c
@@ -1232,15 +1232,21 @@ static struct supertype *match_metadata_desc1(char *arg)
st->ss = &super1;
st->max_devs = 384;
st->sb = NULL;
- if (strcmp(arg, "1.0") == 0) {
+ /* leading zeros can be safely ignored. --detail generates them. */
+ while (*arg == '0')
+ arg++;
+ if (strcmp(arg, "1.0") == 0 ||
+ strcmp(arg, "1.00") == 0) {
st->minor_version = 0;
return st;
}
- if (strcmp(arg, "1.1") == 0) {
+ if (strcmp(arg, "1.1") == 0 ||
+ strcmp(arg, "1.01") == 0) {
st->minor_version = 1;
return st;
}
- if (strcmp(arg, "1.2") == 0) {
+ if (strcmp(arg, "1.2") == 0 ||
+ strcmp(arg, "1.02") == 0) {
st->minor_version = 2;
return st;
}