about summary refs log tree commit diff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-20 00:17:50 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-20 00:34:22 +0100
commit2c2a7b608e01d2347812a84ecb08f98cb4d13789 (patch)
tree7ff48c38ec1c37bef3e1f46139e82495d669d6df /surf.c
parentAdapt setstyle() (diff)
downloadsurf-2c2a7b608e01d2347812a84ecb08f98cb4d13789.tar.gz
surf-2c2a7b608e01d2347812a84ecb08f98cb4d13789.tar.bz2
surf-2c2a7b608e01d2347812a84ecb08f98cb4d13789.zip
Simplify building of stylefiles path
We can directly use style file pointers instead of using temporary
string pointers.
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/surf.c b/surf.c
index f227d4c..4251690 100644
--- a/surf.c
+++ b/surf.c
@@ -1263,7 +1263,6 @@ void
 setup(void)
 {
 	int i;
-	char *styledirfile, *stylepath;
 	WebKitWebContext *context;
 	GError *error = NULL;
 
@@ -1282,6 +1281,7 @@ setup(void)
 	cookiefile = buildfile(cookiefile);
 	scriptfile = buildfile(scriptfile);
 	cachedir   = buildpath(cachedir);
+
 	if (stylefile == NULL) {
 		styledir = buildpath(styledir);
 		for (i = 0; i < LENGTH(styles); i++) {
@@ -1292,19 +1292,12 @@ setup(void)
 				        styles[i].regex);
 				styles[i].regex = NULL;
 			}
-			styledirfile    = g_strconcat(styledir, "/",
-			                              styles[i].style, NULL);
-			stylepath       = buildfile(styledirfile);
-			styles[i].style = g_strconcat("file://", stylepath,
-			                              NULL);
-			g_free(styledirfile);
-			g_free(stylepath);
+			styles[i].style = g_strconcat(styledir, "/",
+			    styles[i].style, NULL);
 		}
 		g_free(styledir);
 	} else {
-		stylepath = buildfile(stylefile);
-		stylefile = g_strconcat("file://", stylepath, NULL);
-		g_free(stylepath);
+		stylefile = buildfile(stylefile);
 	}
 }