Old output:
# blkid -p -o udev /dev/sda{1,3}
ID_FS_LABEL=/boot
ID_FS_LABEL_ENC=\x2fboot
ID_FS_UUID=
f1cd38fa-c887-4ab8-834b-
c8ee659b97fe
ID_FS_UUID_ENC=
f1cd38fa-c887-4ab8-834b-
c8ee659b97fe
ID_FS_VERSION=1.0
ID_FS_TYPE=ext3
ID_FS_USAGE=filesystem
ID_FS_LABEL=BAR
ID_FS_LABEL_ENC=BAR
ID_FS_UUID=
1f2aa318-9c34-462e-8d29-
260819ffd657
ID_FS_UUID_ENC=
1f2aa318-9c34-462e-8d29-
260819ffd657
ID_FS_VERSION=2
ID_FS_TYPE=swap
ID_FS_USAGE=other
new output:
# blkid -p -o udev /dev/sda{1,3}
ID_FS_LABEL=/boot
ID_FS_LABEL_ENC=\x2fboot
ID_FS_UUID=
f1cd38fa-c887-4ab8-834b-
c8ee659b97fe
ID_FS_UUID_ENC=
f1cd38fa-c887-4ab8-834b-
c8ee659b97fe
ID_FS_VERSION=1.0
ID_FS_TYPE=ext3
ID_FS_USAGE=filesystem
ID_FS_LABEL=BAR
ID_FS_LABEL_ENC=BAR
ID_FS_UUID=
1f2aa318-9c34-462e-8d29-
260819ffd657
ID_FS_UUID_ENC=
1f2aa318-9c34-462e-8d29-
260819ffd657
ID_FS_VERSION=2
ID_FS_TYPE=swap
ID_FS_USAGE=other
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
int fd;
int rc = 0;
struct stat st;
+ static int first = 1;
fd = open(devname, O_RDONLY);
if (fd < 0) {
nvals = blkid_probe_numof_values(pr);
+ if (nvals && !first && output & OUTPUT_UDEV_LIST)
+ /* add extra line between output from devices */
+ fputc('\n', stdout);
+
if (output & OUTPUT_DEVICE_ONLY) {
printf("%s\n", devname);
goto done;
print_value(output, num++, devname, (char *) data, name, len);
}
+ if (first)
+ first = 0;
if (nvals >= 1 && !(output & (OUTPUT_VALUE_ONLY | OUTPUT_UDEV_LIST)))
printf("\n");
done: