Replace g_build_path with g_build_filename for portability
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 23 May 2019 19:02:38 +0000 (15:02 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 23 May 2019 20:05:22 +0000 (16:05 -0400)
g_build_filename will use the correct separator depending on the
platform.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Change-Id: Iaeeb1a4c30aaea7690ba479ba05108c6fc57dd4e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1331
Tested-by: jenkins
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/lttng-utils/debug-info/bin-info.c

index eeac6b4b58bf98a35d892a93be1e7809bd9a0565..f861b2ed78966aeb56118bf583dc4a85884156d3 100644 (file)
@@ -90,8 +90,7 @@ struct bin_info *bin_info_create(struct bt_fd_cache *fdc, const char *path,
        }
 
        if (target_prefix) {
-               bin->elf_path = g_build_path("/", target_prefix,
-                                               path, NULL);
+               bin->elf_path = g_build_filename(target_prefix, path, NULL);
        } else {
                bin->elf_path = g_strdup(path);
        }
@@ -592,7 +591,7 @@ int bin_info_set_dwarf_info_build_id(struct bin_info *bin)
        g_snprintf(&build_id_file[build_id_char_len], build_id_suffix_char_len,
                BUILD_ID_SUFFIX);
 
-       path = g_build_path("/", dbg_dir, BUILD_ID_SUBDIR, build_id_file, NULL);
+       path = g_build_filename(dbg_dir, BUILD_ID_SUBDIR, build_id_file, NULL);
        if (!path) {
                goto error;
        }
This page took 0.025128 seconds and 4 git commands to generate.