libmultipath: fix partition_delimiter config option
authorMartin Wilck <mwilck@suse.com>
Sat, 2 Sep 2017 22:38:30 +0000 (00:38 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 20 Sep 2017 13:54:38 +0000 (15:54 +0200)
The partition_delimiter setting was effecitvely ignored. Fix it.

Fixes: 95bf339bb9d7 "correctly set partition delimiter on rename"
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/devmapper.c

index 3b41a48..e701e80 100644 (file)
@@ -1351,10 +1351,12 @@ dm_rename_partmaps (const char * old, char * new, char *delim)
 
        if (delim)
                rd.delim = delim;
-       if (isdigit(new[strlen(new)-1]))
-               rd.delim = "p";
-       else
-               rd.delim = "";
+       else {
+               if (isdigit(new[strlen(new)-1]))
+                       rd.delim = "p";
+               else
+                       rd.delim = "";
+       }
        return do_foreach_partmaps(old, rename_partmap, &rd);
 }