The 'p' delimiter is supposed to be added when the base disk name
ends in a digit. This decision was based on the name given on the
command line, not the canonical device name, so giving /dev/dm-0
instead of /dev/mapper/foo triggered the digit test and added the
'p'. Changed test to use the canonical name rather than the given
name.
device = loopdev;
}
- if (delim == NULL) {
- delim = malloc(DELIM_SIZE);
- memset(delim, 0, DELIM_SIZE);
- set_delimiter(device, delim);
- }
-
off = find_devname_offset(device);
if (!loopdev) {
return 0;
}
+ if (delim == NULL) {
+ delim = malloc(DELIM_SIZE);
+ memset(delim, 0, DELIM_SIZE);
+ set_delimiter(device, delim);
+ }
+
fd = open(device, O_RDONLY);
if (fd == -1) {