Fix support for --update=swapsuper

The user of dup_super broke it.
This commit is contained in:
Neil Brown 2008-05-15 15:50:48 +10:00
parent 294d6f450f
commit ff1f6545db
2 changed files with 4 additions and 2 deletions

View File

@ -856,7 +856,8 @@ static struct supertype *match_metadata_desc0(char *arg)
return st;
st->minor_version = 9; /* flag for 'byte-swapped' */
if (strcmp(arg, "0.swap")==0)
if (strcmp(arg, "0.swap")==0 ||
strcmp(arg, "0.9") == 0) /* For dup_super support */
return st;
free(st);

3
util.c
View File

@ -781,7 +781,8 @@ struct supertype *dup_super(struct supertype *st)
for (i = 0; stnew == NULL && superlist[i] ; i++)
stnew = superlist[i]->match_metadata_desc(verstr);
stnew->sb = NULL;
if (stnew)
stnew->sb = NULL;
return stnew;
}