summaryrefslogtreecommitdiff
path: root/udev_rules.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-07-07 23:43:13 +0200
committerKay Sievers <kay.sievers@suse.de>2005-07-07 23:43:13 +0200
commit7b2bdb4b1bd9e273ea67e4538be3f7d3545331fa (patch)
tree25cd70b93e92a443bc14ed90d41c2b74065a89af /udev_rules.c
parent97c0448d9a5626a28a60cc3306e9360f45409fd9 (diff)
fix symlink values separated by multiple spaces
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_rules.c')
-rw-r--r--udev_rules.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/udev_rules.c b/udev_rules.c
index 41855eb9d7..a25c2e90a8 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -958,16 +958,22 @@ int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev, struct s
/* add multiple symlinks separated by spaces */
pos = temp;
- next = strchr(temp, ' ');
+ while (isspace(pos[0]))
+ pos++;
+ next = strchr(pos, ' ');
while (next) {
next[0] = '\0';
info("add symlink '%s'", pos);
name_list_add(&udev->symlink_list, pos, 0);
+ while (isspace(next[1]))
+ next++;
pos = &next[1];
next = strchr(pos, ' ');
}
- info("add symlink '%s'", pos);
- name_list_add(&udev->symlink_list, pos, 0);
+ if (pos[0] != '\0') {
+ info("add symlink '%s'", pos);
+ name_list_add(&udev->symlink_list, pos, 0);
+ }
}
/* set name, later rules with name set will be ignored */