From 3a4743e5aed552460840fe4b1dbc0990ca4dd91f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 29 May 2015 09:49:07 +0200 Subject: do not add empty string --- udev-block-notify.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/udev-block-notify.c b/udev-block-notify.c index 06ea7e2..10ec41b 100644 --- a/udev-block-notify.c +++ b/udev-block-notify.c @@ -161,29 +161,29 @@ int main (int argc, char ** argv) { * Values available differs from device type and content */ /* file system */ - if ((value = udev_device_get_property_value(dev, "ID_FS_LABEL")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_FS_LABEL")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Label", value); - if ((value = udev_device_get_property_value(dev, "ID_FS_TYPE")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_FS_TYPE")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Type", value); - if ((value = udev_device_get_property_value(dev, "ID_FS_USAGE")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_FS_USAGE")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Usage", value); - if ((value = udev_device_get_property_value(dev, "ID_FS_UUID")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_FS_UUID")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "UUID", value); /* partition */ - if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Partition Table Type", value); - if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_NAME")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_PART_TABLE_NAME")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Partition Name", value); - if ((value = udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) != NULL) + if ((value = udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Partition Type", value); /* device mapper */ - if ((value = udev_device_get_property_value(dev, "DM_NAME")) != NULL) + if ((value = udev_device_get_property_value(dev, "DM_NAME")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Device mapper name", value); /* multi disk */ - if ((value = udev_device_get_property_value(dev, "MD_LEVEL")) != NULL) + if ((value = udev_device_get_property_value(dev, "MD_LEVEL")) != NULL && *value != 0) notifystr = appendstr(TEXT_TAG, notifystr, "Multi disk level", value); if (verbose > 0) -- cgit v1.2.3-54-g00ecf