From 7b2bdb4b1bd9e273ea67e4538be3f7d3545331fa Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 7 Jul 2005 23:43:13 +0200 Subject: [PATCH] fix symlink values separated by multiple spaces Signed-off-by: Kay Sievers --- test/udev-test.pl | 11 +++++++++++ udev_rules.c | 12 +++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/test/udev-test.pl b/test/udev-test.pl index 6fbc23e5..873780d7 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -799,6 +799,17 @@ EOF exp_target => "ttyUSB0", rules => < "multiple symlinks with a lot of s p a c e s", + subsys => "tty", + devpath => "/class/tty/ttyUSB0", + exp_name => "one", + not_exp_name => " ", + exp_target => "ttyUSB0", + rules => <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 */ -- 2.39.5