diff options
author | Tom Gundersen <teg@jklm.no> | 2014-11-28 21:51:45 +0100 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-12-01 19:46:05 -0500 |
commit | 27c0fc5c9840953152a057db2a4666f433cb04bf (patch) | |
tree | 1cea6245c038b575ee2183d21f1bd40ef81f3fd3 /src | |
parent | b3a572ddf5623be53c2690a1412b61a95315a724 (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 ('')
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udev-rules.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index eb8c28a407..7944624434 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1072,7 +1072,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; |