[gnome-commander] Fix fullpath when stepping up one directory



commit f2dbaae3096c135856187f48af9e0c4b28cf0939
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sat Apr 24 22:40:21 2021 +0200

    Fix fullpath when stepping up one directory

 src/gnome-cmd-plain-path.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/gnome-cmd-plain-path.cc b/src/gnome-cmd-plain-path.cc
index 44f4acfe..32b1f8da 100644
--- a/src/gnome-cmd-plain-path.cc
+++ b/src/gnome-cmd-plain-path.cc
@@ -29,7 +29,9 @@ using namespace std;
 
 GnomeCmdPath *GnomeCmdPlainPath::get_parent()
 {
-    auto fullPath     = g_strconcat(G_DIR_SEPARATOR_S, path, nullptr);
+    auto fullPath     = *path != '/'
+                        ? g_strconcat(G_DIR_SEPARATOR_S, path, nullptr)
+                        : g_strdup(path);
     auto gFileForPath = g_file_new_for_path(fullPath);
     auto gFileParent  = g_file_get_parent(gFileForPath);
     g_object_unref(gFileForPath);


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