]> err.no Git - systemd/commitdiff
[PATCH] check for empty symlink string
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Tue, 30 Dec 2003 09:07:57 +0000 (01:07 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:13:12 +0000 (21:13 -0700)
Attached is a patch for udev-add.c to ignore empty symlink string parts.
Issue was brought up by ide-devfs.sh with only one symlink returned, while two are expected.

udev-add.c

index ba5c864165234e83b9072bb4a349cdb7b46f37d4..2f72613ea9fca7918b77908fd413e7d1d357cbde 100644 (file)
@@ -193,7 +193,7 @@ static int create_node(struct udevice *dev)
                symlinks = dev->symlink;
                while (1) {
                        linkname = strsep(&symlinks, " ");
-                       if (linkname == NULL)
+                       if (linkname == NULL || linkname[0] == '\0')
                                break;
 
                        strncpy(filename, udev_root, sizeof(filename));