changeset 705:a7009e2c4a0b

Use g_build_filename().
author zas_
date Tue, 20 May 2008 22:22:11 +0000
parents 839525c4e85f
children 066b90ad9925
files src/cache.c
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache.c	Tue May 20 22:13:48 2008 +0000
+++ b/src/cache.c	Tue May 20 22:22:11 2008 +0000
@@ -656,24 +656,20 @@
 	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;
 		}