summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-11-28 21:51:45 +0100
committerTom Gundersen <teg@jklm.no>2014-11-28 21:57:52 +0100
commit9f5ecdb0b11557be41c065f460bb22ab52bb0034 (patch)
tree63eaa1c1b71e9114ac235c3bcd8fcb0af16443d7
parent6501b52d358aa2c7fe28e477f9d5acf0a2991d32 (diff)
udev: rules - ignore the lack of trailing newline
Also accept '\r' as newline character. This dropps warnings of the type: invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules on line 26, starting at character 25 ('')
-rw-r--r--src/udev/udev-rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 131abd69f5..447a86864e 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1067,7 +1067,7 @@ static int add_rule(struct udev_rules *rules, char *line,
/* If we aren't at the end of the line, this is a parsing error.
* Make a best effort to describe where the problem is. */
- if (*linepos != '\n') {
+ if (!strchr(NEWLINE "\0", *linepos)) {
char buf[2] = {*linepos};
_cleanup_free_ char *tmp;