Use g_build_filename().
authorLaurent Monin <geeqie@norz.org>
Tue, 20 May 2008 22:22:11 +0000 (22:22 +0000)
committerLaurent Monin <geeqie@norz.org>
Tue, 20 May 2008 22:22:11 +0000 (22:22 +0000)
src/cache.c

index 346df24..cf3ff7c 100644 (file)
@@ -656,24 +656,20 @@ gchar *cache_get_location(CacheType type, const gchar *source, gint include_name
        base = remove_level_from_path(source);
        if (include_name)
                {
-               name = g_strconcat("/", filename_from_path(source), NULL);
-               }
-       else
-               {
-               cache_ext = NULL;
+               name = g_strconcat(filename_from_path(source), cache_ext, NULL);
                }
 
        if (((type != CACHE_TYPE_METADATA && options->thumbnails.cache_into_dirs) ||
             (type == CACHE_TYPE_METADATA && options->enable_metadata_dirs)) &&
            access_file(base, W_OK))
                {
-               path = g_strconcat(base, "/", cache_local, name, cache_ext, NULL);
+               path = g_build_filename(base, cache_local, name, NULL);
                if (mode) *mode = 0775;
                }
 
        if (!path)
                {
-               path = g_strconcat(homedir(), "/", cache_rc, base, name, cache_ext, NULL);
+               path = g_build_filename(homedir(), cache_rc, base, name, NULL);
                if (mode) *mode = 0755;
                }