udev-rules: do not ignore short lines

Otherwise, a short line continues the previous continuation.

This fixes a bug introduced by f10aa08e3e.
This commit is contained in:
Yu Watanabe 2019-02-21 17:29:29 +09:00
parent 7e85b073c7
commit e8b2737f20
1 changed files with 2 additions and 4 deletions

View File

@ -1496,8 +1496,6 @@ static int parse_file(UdevRules *rules, const char *filename) {
continue;
len = strlen(line);
if (len < 3)
continue;
if (continuation && !ignore_line) {
if (strlen(continuation) + len >= UTIL_LINE_SIZE)
@ -1512,7 +1510,7 @@ static int parse_file(UdevRules *rules, const char *filename) {
}
}
if (line[len - 1] == '\\') {
if (len > 0 && line[len - 1] == '\\') {
if (ignore_line)
continue;
@ -1528,7 +1526,7 @@ static int parse_file(UdevRules *rules, const char *filename) {
if (ignore_line)
log_error("Line too long '%s':%u, ignored", filename, line_nr);
else
else if (len > 0)
add_rule(rules, line, filename, filename_off, line_nr);
continuation = mfree(continuation);