[Xfce4-commits] <gigolo:master> Properly skip leading slashes when validating path and share fields

Enrico Tröger noreply at xfce.org
Sun Apr 22 22:00:05 CEST 2012


Updating branch refs/heads/master
         to aff81c5c36e233d58671663634f35f03fc76b22c (commit)
       from 78c0bf1f89da169a3aa6c8999d002fc216870957 (commit)

commit aff81c5c36e233d58671663634f35f03fc76b22c
Author: Enrico Tröger <enrico at xfce.org>
Date:   Sun Apr 22 21:58:59 2012 +0200

    Properly skip leading slashes when validating path and share fields

 src/bookmarkeditdialog.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/bookmarkeditdialog.c b/src/bookmarkeditdialog.c
index 3158606..16b1cf4 100644
--- a/src/bookmarkeditdialog.c
+++ b/src/bookmarkeditdialog.c
@@ -294,7 +294,9 @@ gint gigolo_bookmark_edit_dialog_run(GigoloBookmarkEditDialog *dialog)
 				tmp = gtk_entry_get_text(GTK_ENTRY(priv->path_entry));
 				if (tmp[0] == '/')
 				{	/* remove leading slashes */
-					gtk_entry_set_text(GTK_ENTRY(priv->path_entry), tmp + 1);
+					gchar *path = g_strdup(tmp);
+					gtk_entry_set_text(GTK_ENTRY(priv->path_entry), path + 1);
+					g_free(path);
 				}
 			}
 			if (! error && gtk_widget_get_parent(priv->share_entry) != NULL)
@@ -302,7 +304,9 @@ gint gigolo_bookmark_edit_dialog_run(GigoloBookmarkEditDialog *dialog)
 				tmp = gtk_entry_get_text(GTK_ENTRY(priv->share_entry));
 				if (tmp[0] == '/')
 				{	/* remove leading slashes */
-					gtk_entry_set_text(GTK_ENTRY(priv->share_entry), tmp + 1);
+					gchar *share = g_strdup(tmp);
+					gtk_entry_set_text(GTK_ENTRY(priv->share_entry), share + 1);
+					g_free(share);
 				}
 			}
 			if (! error)


More information about the Xfce4-commits mailing list