Am 01.06.2017 um 00:53 schrieb Michael Biebl: > Am 01.06.2017 um 00:34 schrieb Michael Biebl:
>> The result is //lib/udev/hwdb.bin, note the double // > > Fwiw, we could stick a > path_kill_slashes(hwdb_bin); > after the strjoin like in the attached patch. Hm, using path_join() might be even nicer (assuming arg_hwdb_bin_dir itself doesn't contain any double slashes, which is probably a safe assumption). Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c index a9539c812..793398ca6 100644 --- a/src/hwdb/hwdb.c +++ b/src/hwdb/hwdb.c @@ -31,6 +31,7 @@ #include "hwdb-util.h" #include "label.h" #include "mkdir.h" +#include "path-util.h" #include "selinux-util.h" #include "strbuf.h" #include "string-util.h" @@ -670,7 +671,7 @@ static int hwdb_update(int argc, char *argv[], void *userdata) { log_debug("strings dedup'ed: %8zu bytes (%8zu)", trie->strings->dedup_len, trie->strings->dedup_count); - hwdb_bin = strjoin(arg_root, "/", arg_hwdb_bin_dir, "/hwdb.bin"); + hwdb_bin = path_join(arg_root, arg_hwdb_bin_dir, "hwdb.bin"); if (!hwdb_bin) return -ENOMEM;
signature.asc
Description: OpenPGP digital signature