[gthumb] Fix .. element in location sidebar, bug 525482



commit 95aedbd4c0ca1ca4e7b0695d6fb4e03cdd2b5ac0
Author: Marlodavampire <brooss teambb gmail com>
Date:   Wed Jun 3 09:37:07 2009 -0400

    Fix .. element in location sidebar, bug 525482
---
 libgthumb/file-utils.c |    2 ++
 src/gth-dir-list.c     |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index 6875c76..44d9188 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -1647,6 +1647,8 @@ uri_is_root (const char *uri)
 		return TRUE;
 
 	len = strlen (uri);
+	if (strncmp (uri + len - 4, ":///", 4) == 0)
+		return TRUE;
 	if (strncmp (uri + len - 3, "://", 3) == 0)
 		return TRUE;
 	if (strncmp (uri + len - 2, ":/", 2) == 0)
diff --git a/src/gth-dir-list.c b/src/gth-dir-list.c
index 9115f59..d5a4d18 100644
--- a/src/gth-dir-list.c
+++ b/src/gth-dir-list.c
@@ -742,8 +742,13 @@ gth_dir_list_get_path_from_iter (GthDirList  *dir_list,
 
 	if (strcmp (name, ".") == 0)
 		new_path = g_strdup (dir_list->path);
-	else if (strcmp (name, "..") == 0)
+	else if (strcmp (name, "..") == 0) {
 		new_path = remove_level_from_path (dir_list->path);
+		if (same_uri (new_path, "file://")) {
+			g_free (new_path);
+			new_path = g_strdup ("file:///");
+		}
+	}
 	else {
 		if (same_uri (dir_list->path, "/"))
 			new_path = g_strconcat (dir_list->path,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]