mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-05 09:17:44 +03:00
udev-rules: avoid erroring on trailing whitespace
https://bugs.archlinux.org/task/36950
This commit is contained in:
parent
d8c8508bad
commit
3cf0f8f7e0
@ -1068,6 +1068,12 @@ static int add_rule(struct udev_rules *rules, char *line,
|
||||
enum operation_type op;
|
||||
|
||||
if (get_key(rules->udev, &linepos, &key, &op, &value) != 0) {
|
||||
/* Avoid erroring on trailing whitespace. This is probably rare
|
||||
* so save the work for the error case instead of always trying
|
||||
* to strip the trailing whitespace with strstrip(). */
|
||||
while (isblank(*linepos))
|
||||
linepos++;
|
||||
|
||||
/* 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') {
|
||||
|
Loading…
Reference in New Issue
Block a user