If we need to add digits to a name to make it unique, but don't have
to add '_', we need to avoid adding a digit immediately after a digit.
So if the last character of the name is a digit, add the '_' anyway.
Signed-off-by: NeilBrown <neilb@suse.de>
}
cnlen = strlen(cname);
while (conflict) {
- if (trustworthy == METADATA)
+ if (trustworthy == METADATA && !isdigit(cname[cnlen-1]))
sprintf(cname+cnlen, "%d", unum);
else
/* add _%d to FOREIGN array that don't