From: NeilBrown Date: Mon, 11 May 2009 23:49:06 +0000 (+1000) Subject: Ignore leading zeros in version number information. X-Git-Tag: mdadm-3.0~2^2~1 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=6957819fe61c0366565bfb2588982773ed010dfa Ignore leading zeros in version number information. --detail sometimes generates leading zero which are just noise. --- diff --git a/super1.c b/super1.c index 037c5eb2..e545bf5b 100644 --- a/super1.c +++ b/super1.c @@ -1204,15 +1204,18 @@ static struct supertype *match_metadata_desc1(char *arg) /* Eliminate pointless leading 0 from some versions of mdadm -D */ if (strncmp(arg, "01.", 3) == 0) arg++; - if (strcmp(arg, "1.0") == 0) { + 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; }