mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
don't report an error on overlong comment lines
This commit is contained in:
parent
9a8ad783a4
commit
d4ae9925ee
@ -1498,6 +1498,18 @@ EOF
|
|||||||
rules => <<EOF
|
rules => <<EOF
|
||||||
KERNEL="sda1", NAME=="no"
|
KERNEL="sda1", NAME=="no"
|
||||||
KERNEL=="sda1", NAME="yes"
|
KERNEL=="sda1", NAME="yes"
|
||||||
|
EOF
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc => "overlong comment line",
|
||||||
|
subsys => "block",
|
||||||
|
devpath => "/block/sda/sda1",
|
||||||
|
exp_name => "yes",
|
||||||
|
rules => <<EOF
|
||||||
|
# 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
|
||||||
|
# 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
|
||||||
|
KERNEL="sda1", NAME=="no"
|
||||||
|
KERNEL=="sda1", NAME="yes"
|
||||||
EOF
|
EOF
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -543,7 +543,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
|
|||||||
continue;
|
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 */
|
/* 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;
|
cur += count+1;
|
||||||
lineno++;
|
lineno++;
|
||||||
|
|
||||||
if (count >= sizeof(line)) {
|
|
||||||
err("line too long, rule skipped '%s:%u'", filename, lineno);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* eat the whitespace */
|
/* eat the whitespace */
|
||||||
while ((count > 0) && isspace(bufline[0])) {
|
while ((count > 0) && isspace(bufline[0])) {
|
||||||
bufline++;
|
bufline++;
|
||||||
@ -620,6 +615,11 @@ static int parse_file(struct udev_rules *rules, const char *filename)
|
|||||||
if (bufline[0] == COMMENT_CHARACTER)
|
if (bufline[0] == COMMENT_CHARACTER)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (count >= sizeof(line)) {
|
||||||
|
err("line too long, rule skipped '%s:%u'", filename, lineno);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* skip backslash and newline from multiline rules */
|
/* skip backslash and newline from multiline rules */
|
||||||
for (i = j = 0; i < count; i++) {
|
for (i = j = 0; i < count; i++) {
|
||||||
if (bufline[i] == '\\' && bufline[i+1] == '\n')
|
if (bufline[i] == '\\' && bufline[i+1] == '\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user