Ignore leading zeros in version number information.
--detail sometimes generates leading zero which are just noise.
This commit is contained in:
parent
7b187ed7e9
commit
9b2a22d319
3
super0.c
3
super0.c
|
@ -893,6 +893,9 @@ static struct supertype *match_metadata_desc0(char *arg)
|
|||
st->minor_version = 90;
|
||||
st->max_devs = MD_SB_DISKS;
|
||||
st->sb = NULL;
|
||||
/* we sometimes get 00.90 */
|
||||
while (arg[0] == '0' && arg[1] == '0')
|
||||
arg++;
|
||||
if (strcmp(arg, "0") == 0 ||
|
||||
strcmp(arg, "0.90") == 0 ||
|
||||
strcmp(arg, "default") == 0 ||
|
||||
|
|
12
super1.c
12
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue