changeset 721:b736a2e3129b

tab_completion_popup_cb(): use g_build_filename() and simplify code.
author zas_
date Wed, 21 May 2008 09:58:29 +0000
parents d8a88f279aca
children 9a145206ec2c
files src/ui_tabcomp.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_tabcomp.c	Wed May 21 09:50:32 2008 +0000
+++ b/src/ui_tabcomp.c	Wed May 21 09:58:29 2008 +0000
@@ -217,13 +217,11 @@
 	gchar *name = data;
 	TabCompData *td;
 	gchar *buf;
-	gchar *ptr;
 
 	td = g_object_get_data(G_OBJECT(widget), "tab_completion_data");
 	if (!td) return;
 
-	ptr = td->dir_path + strlen(td->dir_path) - 1;
-	buf = g_strconcat(td->dir_path, (ptr[0] == '/') ? "" : "/", name, NULL);
+	buf = g_build_filename(td->dir_path, name, NULL);
 	gtk_entry_set_text(GTK_ENTRY(td->entry), buf);
 	gtk_editable_set_position(GTK_EDITABLE(td->entry), strlen(buf));
 	g_free(buf);