about summary refs log tree commit diff stats
path: root/xxxterm.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-01-12 02:56:37 +0000
committerMarco Peereboom <marco@conformal.com>2011-01-12 02:56:37 +0000
commitac3b52d10bb2829d8996c842eed79177cdd33d10 (patch)
tree8451befdc0b676dcf24a806f094101a299c8ec90 /xxxterm.c
parentc113b28e56b988a9e0e3fd8f94d69a0862b60bee (diff)
downloadxombrero-ac3b52d10bb2829d8996c842eed79177cdd33d10.tar.gz
fix longstanding bug where one couldn't open files that contained spaces
Diffstat (limited to 'xxxterm.c')
-rw-r--r--xxxterm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xxxterm.c b/xxxterm.c
index a419b94..9cbc1e0 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -903,14 +903,15 @@ match_alias(char *url_in)
 {
 	struct alias		*a;
 	char			*arg;
-	char			*url_out = NULL;
+	char			*url_out = NULL, *search;
 
-	arg = url_in;
+	search = g_strdup(url_in);
+	arg = search;
 	if (strsep(&arg, " \t") == NULL)
 		errx(1, "match_alias: NULL URL");
 
 	TAILQ_FOREACH(a, &aliases, entry) {
-		if (!strcmp(url_in, a->a_name))
+		if (!strcmp(search, a->a_name))
 			break;
 	}
 
@@ -923,6 +924,8 @@ match_alias(char *url_in)
 			url_out = g_strdup(a->a_uri);
 	}
 
+	g_free(search);
+
 	return (url_out);
 }