]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-event: add replace_whitespace param to udev_event_apply_format
authorDan Streetman <ddstreet@ieee.org>
Tue, 3 Jan 2017 19:37:59 +0000 (14:37 -0500)
committerDan Streetman <ddstreet@ieee.org>
Tue, 3 Jan 2017 22:12:00 +0000 (17:12 -0500)
commite20a917105b9c41e7e552ca5f11f9077897db505
tree9ddcde368c6ee21f3e78d2d02eb5a55f3bb96864
parenta9d99b32a34589777e95898dac0597dbfbede4ea
udev-event: add replace_whitespace param to udev_event_apply_format

If replace_whitespace is true, each substitution value has all its
whitespace removed/replaced by util_replace_whitespace (except the
SUBST_RESULT substitution - $result{} or %c{} - which handles spaces
itself as field separators).  All existing callers are updated to
pass false, so no functional change is made by this patch.

This is needed so the SYMLINK assignment can replace any spaces
introduced through variable substitution, becuase the SYMLINK value is
a space-separated list of symlinks to create.  Any variables that
contain spaces will thus unexpectedly change the symlink value from
a single symlink to multiple incorrectly-named symlinks.

This is used in the next patch, which enables the whitespace
replacement for SYMLINK variable substitution.
src/udev/udev-event.c
src/udev/udev-rules.c
src/udev/udev.h
src/udev/udevadm-test.c