summaryrefslogtreecommitdiff
path: root/udev_rules_parse.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-08-13 04:23:16 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-13 04:23:16 +0200
commitd4ae9925eecf6df33ca5bc4d285bdc71f9274952 (patch)
tree20ce3c67f403bdb94bce5555a4a161f29e97d9db /udev_rules_parse.c
parent9a8ad783a48791c5eaa35697d0a4befd705085fd (diff)
don't report an error on overlong comment lines
Diffstat (limited to 'udev_rules_parse.c')
-rw-r--r--udev_rules_parse.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index 271de6f879..8d69e74864 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -543,7 +543,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
continue;
}
- err("unknown key '%s'", key);
+ err("unknown key '%s' in %s:%u", key, filename, lineno);
}
/* skip line if not any valid key was found */
@@ -603,11 +603,6 @@ static int parse_file(struct udev_rules *rules, const char *filename)
cur += count+1;
lineno++;
- if (count >= sizeof(line)) {
- err("line too long, rule skipped '%s:%u'", filename, lineno);
- continue;
- }
-
/* eat the whitespace */
while ((count > 0) && isspace(bufline[0])) {
bufline++;
@@ -620,7 +615,12 @@ static int parse_file(struct udev_rules *rules, const char *filename)
if (bufline[0] == COMMENT_CHARACTER)
continue;
- /* skip backslash and newline from multi line rules */
+ if (count >= sizeof(line)) {
+ err("line too long, rule skipped '%s:%u'", filename, lineno);
+ continue;
+ }
+
+ /* skip backslash and newline from multiline rules */
for (i = j = 0; i < count; i++) {
if (bufline[i] == '\\' && bufline[i+1] == '\n')
continue;