From 6957819fe61c0366565bfb2588982773ed010dfa Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 12 May 2009 09:49:06 +1000 Subject: [PATCH] Ignore leading zeros in version number information. --detail sometimes generates leading zero which are just noise. --- super1.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.47.2