summaryrefslogtreecommitdiff
path: root/udevtrigger.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-03-14 21:41:33 +0100
committerKay Sievers <kay.sievers@vrfy.org>2007-03-14 21:41:33 +0100
commit9c6ad9fbbac82e517f5e748ddbe166f96f120afe (patch)
tree2021ceed05626469a75280a6c1b5cc897e157a75 /udevtrigger.c
parent5edec024b1ed7bbdf73095791c13df324038c31d (diff)
encode db-file names, instead of just replacing '/'
Diffstat (limited to 'udevtrigger.c')
-rw-r--r--udevtrigger.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/udevtrigger.c b/udevtrigger.c
index c809d2d47b..2bdd0c8d07 100644
--- a/udevtrigger.c
+++ b/udevtrigger.c
@@ -407,22 +407,15 @@ static void scan_failed(void)
if (dir != NULL) {
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
char device[PATH_SIZE];
- size_t start, end, i;
+ size_t start;
if (dent->d_name[0] == '.')
continue;
strlcpy(device, sysfs_path, sizeof(device));
start = strlcat(device, "/", sizeof(device));
- end = strlcat(device, dent->d_name, sizeof(device));
- if (end > sizeof(device))
- end = sizeof(device);
-
- /* replace PATH_TO_NAME_CHAR with '/' */
- for (i = start; i < end; i++)
- if (device[i] == PATH_TO_NAME_CHAR)
- device[i] = '/';
-
+ strlcat(device, dent->d_name, sizeof(device));
+ path_decode(&device[start]);
device_list_insert(device);
}
closedir(dir);