about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRaphael Graf <r@undefined.ch>2011-05-21 16:46:07 +0000
committerRaphael Graf <r@undefined.ch>2011-05-21 16:46:07 +0000
commit1d54b40407c51ff12d14410539f675681a10f07e (patch)
tree1236f981a044d0ddf03bca549cf3480d826e94c1
parent20d12f9ab9d0f1a22d1b74b7a4d43109870706c6 (diff)
downloadxombrero-1d54b40407c51ff12d14410539f675681a10f07e.tar.gz
Fix command-completion on linux
ok marco@
-rw-r--r--xxxterm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xxxterm.c b/xxxterm.c
index d6a5b25..6cc1070 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -6640,7 +6640,6 @@ cmd_complete(struct tab *t, char *str, int dir)
 	s += i;
 
 	levels = cmd_tokenize(s, tokens);
-	g_free(sc);
 
 	for (i = 0; i < levels - 1; i++) {
 		tok = tokens[i];
@@ -6662,8 +6661,10 @@ cmd_complete(struct tab *t, char *str, int dir)
 			strlcat(res, tok, sizeof res);
 			strlcat(res, " ", sizeof res);
 			dep++;
-		} else
+		} else {
+			g_free(sc);
 			return;
+		}
 
 		parent = c - 1;
 	}
@@ -6677,6 +6678,8 @@ cmd_complete(struct tab *t, char *str, int dir)
 		gtk_entry_set_text(w, res);
 		gtk_editable_set_position(GTK_EDITABLE(w), -1);
 	}
+
+	g_free(sc);
 }
 
 gboolean