summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--namedev_parse.c2
-rw-r--r--test/udev-test.pl9
2 files changed, 10 insertions, 1 deletions
diff --git a/namedev_parse.c b/namedev_parse.c
index 7cd676c390..02d8a6520c 100644
--- a/namedev_parse.c
+++ b/namedev_parse.c
@@ -153,7 +153,7 @@ static int namedev_parse(const char *filename, void *data)
/* skip backslash and newline from multi line rules */
for (i = j = 0; i < count; i++) {
- if (bufline[i] == '\\' || bufline[i] == '\n')
+ if (bufline[i] == '\\' && bufline[i+1] == '\n')
continue;
line[j++] = bufline[i];
diff --git a/test/udev-test.pl b/test/udev-test.pl
index fe7b932669..f442b162ec 100644
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -195,6 +195,15 @@ NAME="visor"
EOF
},
{
+ desc => "preserve backslashes, if they are not for a newline",
+ subsys => "tty",
+ devpath => "/class/tty/ttyUSB0",
+ exp_name => "aaa",
+ conf => <<EOF
+KERNEL="ttyUSB0", PROGRAM="/bin/echo -e \\101", RESULT="A", NAME="aaa"
+EOF
+ },
+ {
desc => "Handle stupid backslashed multi lines in config file (and replace kernel name)",
subsys => "tty",
devpath => "/class/tty/ttyUSB0",