[Xfce4-commits] <gigolo:master> Fix WebDav path parsing when there is no path

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


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

commit 78c0bf1f89da169a3aa6c8999d002fc216870957
Author: Enrico Tröger <enrico at xfce.org>
Date:   Sun Apr 22 21:51:05 2012 +0200

    Fix WebDav path parsing when there is no path

 src/bookmark.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bookmark.c b/src/bookmark.c
index 42874b9..bfc2ec3 100644
--- a/src/bookmark.c
+++ b/src/bookmark.c
@@ -236,12 +236,12 @@ gboolean gigolo_bookmark_parse_uri(GigoloBookmark *bookmark, const gchar *uri)
 
 		/* remove trailing slashes */
 		l = strlen(end);
-		while (end[l-1] == '/')
+		while (*end != '\0' && end[l-1] == '/')
 		{
 			l--;
 		}
-
-		priv->path = g_strndup(end, l);
+		if (l > 0)
+			priv->path = g_strndup(end, l);
 	}
 
 	return TRUE;


More information about the Xfce4-commits mailing list