changeset 709:f4fc939d327b

Build path using g_build_filename() then calculate its length.
author zas_
date Tue, 20 May 2008 23:41:13 +0000
parents 444705451f3a
children a1e8c78a03ab
files src/cache_maint.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache_maint.c	Tue May 20 23:11:47 2008 +0000
+++ b/src/cache_maint.c	Tue May 20 23:41:13 2008 +0000
@@ -140,6 +140,7 @@
 	gint still_have_a_file = TRUE;
 	gint base_length;
 	const gchar *cache_folder;
+	gchar *base;
 
 	if (cm->metadata)
 		{
@@ -150,7 +151,9 @@
 		cache_folder = GQ_CACHE_RC_THUMB;
 		}
 
-	base_length = strlen(homedir()) + strlen("/") + strlen(cache_folder);
+	base = g_build_filename(homedir(), cache_folder, NULL);
+	base_length = strlen(base);
+	g_free(base);
 
 	if (!cm->list)
 		{