| From 0a10235ed4538a80f5fc7dbbf79e3a1c178f5179 Mon Sep 17 00:00:00 2001 |
| From: Dan Streetman <ddstreet@ieee.org> |
| Date: Tue, 3 Jan 2017 14:39:50 -0500 |
| Subject: [PATCH] udev-rules: perform whitespace replacement for symlink subst |
| values |
| |
| If the string_escape option is either unset or 'replace' (i.e. if it is |
| not 'none'), then enable whitespace replacement in SYMLINK variable |
| substitution values, as added in the last patch. |
| |
| This will keep any whitespace that is directly contained in a SYMLINK |
| value, but will replace any whitespace that is added to the SYMLINK |
| value as a result of variable substitution (except $result/%c). |
| |
| This fixes bug 4833. |
| --- |
| src/udev/udev-rules.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c |
| index c688120552..4d07b8fce0 100644 |
| --- a/src/udev/udev-rules.c |
| +++ b/src/udev/udev-rules.c |
| @@ -2336,7 +2336,7 @@ void udev_rules_apply_to_event(struct udev_rules *rules, |
| udev_device_cleanup_devlinks_list(event->dev); |
| |
| /* allow multiple symlinks separated by spaces */ |
| - udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), false); |
| + udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), esc != ESCAPE_NONE); |
| if (esc == ESCAPE_UNSET) |
| count = util_replace_chars(temp, "/ "); |
| else if (esc == ESCAPE_REPLACE) |