summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-util.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-09-18 12:12:04 -0400
committerDave Reisner <dreisner@archlinux.org>2013-09-19 11:50:34 -0400
commit8f6ce71fe79d897b67157d92869db87ee2042af6 (patch)
tree30055a64faf4d6b3aeb0ba84979627a4a23c16b3 /src/libudev/libudev-util.c
parent7991ac34ab08421415b907e42775c5539a4a5bbb (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.
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r--src/libudev/libudev-util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index d54430cad0..b5b9db67fc 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -32,6 +32,7 @@
#include <sys/stat.h>
#include <sys/param.h>
+#include "device-nodes.h"
#include "libudev.h"
#include "libudev-private.h"
#include "utf8.h"
@@ -344,7 +345,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;
}
@@ -392,7 +393,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);
}
/*