diff options
author | Dave Reisner <dreisner@archlinux.org> | 2014-01-09 14:02:56 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-01-09 14:02:56 -0500 |
commit | 855ce449eba82c417c005d17aa680aba2048ed8d (patch) | |
tree | 9c9c5c9cdd30ed2dfbbdef820118124e891b6662 /src/libudev/libudev-util.c | |
parent | 7ed87c74dfb81761cbcefc10cd4f79394a1d36a3 (diff) |
device-nodes: move device node specific code to own file
In the process, rename udev_encode_string which is poorly named
for what it does. It deals specifically with encoding names that
udev creates and has its own rules: utf8 is valid but some ascii
is not (e.g. path separators), and everything else is simply escaped.
Rename it to encode_devnode_name.
Adopted for eudev: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r-- | src/libudev/libudev-util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index b4452f60d4..4d59980a70 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -35,6 +35,7 @@ #include <sys/stat.h> #include <sys/param.h> +#include "device-nodes.h" #include "libudev.h" #include "libudev-private.h" #include "utf8.h" @@ -352,7 +353,7 @@ int util_replace_chars(char *str, const char *white) while (str[i] != '\0') { int len; - if (is_utf8_encoding_whitelisted(str[i], white)) { + if (whitelisted_char_for_devnode(str[i], white)) { i++; continue; } @@ -400,7 +401,7 @@ int util_replace_chars(char *str, const char *white) **/ _public_ int udev_util_encode_string(const char *str, char *str_enc, size_t len) { - return udev_encode_string(str, str_enc, len); + return encode_devnode_name(str, str_enc, len); } /* |