X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fudev-rules.c;h=c9a0197534228608b65e1d69a74c71c5d59dca01;hb=c74f883c6f7d5901b3c543d47f64082ccd91a895;hp=a261fbf9780fd843e99e0adbdc5375a9675d0fb0;hpb=84198c1892cce2cb27d22bfa816da5d43c05add0;p=elogind.git diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index a261fbf97..c9a019753 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1067,14 +1067,14 @@ 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') { - char buf[2] = {linepos[1]}; + if (!strchr(NEWLINE, *linepos)) { + char buf[2] = {*linepos}; _cleanup_free_ char *tmp; tmp = cescape(buf); log_error("invalid key/value pair in file %s on line %u, starting at character %tu ('%s')", filename, lineno, linepos - line + 1, tmp); - if (linepos[1] == '#') + if (*linepos == '#') log_error("hint: comments can only start at beginning of line"); } break;