diff options
author | Dan Streetman <ddstreet@ieee.org> | 2017-01-03 14:37:59 -0500 |
---|---|---|
committer | Dan Streetman <ddstreet@ieee.org> | 2017-01-03 17:12:00 -0500 |
commit | e20a917105b9c41e7e552ca5f11f9077897db505 (patch) | |
tree | 9ddcde368c6ee21f3e78d2d02eb5a55f3bb96864 /src/udev/udev.h | |
parent | a9d99b32a34589777e95898dac0597dbfbede4ea (diff) |
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.
Diffstat (limited to 'src/udev/udev.h')
-rw-r--r-- | src/udev/udev.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/udev/udev.h b/src/udev/udev.h index 8433e8d9f2..c0cb7eae84 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -80,7 +80,9 @@ int udev_rules_apply_static_dev_perms(struct udev_rules *rules); /* udev-event.c */ struct udev_event *udev_event_new(struct udev_device *dev); void udev_event_unref(struct udev_event *event); -size_t udev_event_apply_format(struct udev_event *event, const char *src, char *dest, size_t size); +size_t udev_event_apply_format(struct udev_event *event, + const char *src, char *dest, size_t size, + bool replace_whitespace); int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string, char *result, size_t maxsize, int read_value); int udev_event_spawn(struct udev_event *event, |