# HG changeset patch # User zas_ # Date 1211320285 0 # Node ID b2eb4ff74d131074d34535a84e27c7caad73bb9a # Parent 9873d695a9c1cae49eeb741ca29e4539c1698fa3 Use g_build_filename() to build paths. diff -r 9873d695a9c1 -r b2eb4ff74d13 src/bar_info.c --- a/src/bar_info.c Tue May 20 20:11:29 2008 +0000 +++ b/src/bar_info.c Tue May 20 21:51:25 2008 +0000 @@ -101,8 +101,10 @@ comment_dir = cache_get_location(CACHE_TYPE_METADATA, fd->path, FALSE, &mode); if (cache_ensure_dir_exists(comment_dir, mode)) { - comment_path = g_strconcat(comment_dir, "/", fd->name, - GQ_CACHE_EXT_METADATA, NULL); + gchar *filename = g_strconcat(fd->name, GQ_CACHE_EXT_METADATA, NULL); + + comment_path = g_build_filename(comment_dir, filename, NULL); + g_free(filename); } g_free(comment_dir); } diff -r 9873d695a9c1 -r b2eb4ff74d13 src/bar_sort.c --- a/src/bar_sort.c Tue May 20 20:11:29 2008 +0000 +++ b/src/bar_sort.c Tue May 20 21:51:25 2008 +0000 @@ -94,7 +94,7 @@ history_list_free_key(SORT_KEY_COLLECTIONS); bookmark_list_set_key(bookmarks, SORT_KEY_COLLECTIONS); - collect_path = g_strconcat(homedir(), "/", GQ_RC_DIR_COLLECTIONS, NULL); + collect_path = g_build_filename(homedir(), GQ_RC_DIR_COLLECTIONS, NULL); filelist_read(collect_path, &list, NULL); g_free(collect_path); @@ -433,20 +433,17 @@ else { gchar *path; - gchar *ext; - + if (strlen(name) == 0) return; - if (file_extension_match(name, ".gqv")) + if (!file_extension_match(name, ".gqv")) { - ext = NULL; - } - else - { - ext = ".gqv"; + gchar *tmp = g_strconcat(name, ".gqv", NULL); + g_free((gpointer) name); + name = tmp; } - path = g_strconcat(homedir(), "/", GQ_RC_DIR_COLLECTIONS, "/", name, ext, NULL); + path = g_build_filename(homedir(), GQ_RC_DIR_COLLECTIONS, name, NULL); if (isfile(path)) { gchar *text = g_strdup_printf(_("The collection:\n%s\nalready exists."), name);