[gnome-commander] Fix for initializing the connection base path



commit 2a00ad022f4cf9b9f01c0ceeb7b8941d1c8b6593
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sat Jan 22 00:15:15 2022 +0100

    Fix for initializing the connection base path

 src/dialogs/gnome-cmd-con-dialog.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-con-dialog.cc b/src/dialogs/gnome-cmd-con-dialog.cc
index 1d229c96..63176e5f 100644
--- a/src/dialogs/gnome-cmd-con-dialog.cc
+++ b/src/dialogs/gnome-cmd-con-dialog.cc
@@ -555,7 +555,9 @@ gboolean gnome_cmd_connect_dialog_edit (GnomeCmdConRemote *server)
             g_free(uriString);
 
             gnome_cmd_con_set_scheme(con, uriScheme);
-            gnome_cmd_con_set_base_path(con, uriPath ? new GnomeCmdPlainPath(uriPath) : new 
GnomeCmdPlainPath(G_DIR_SEPARATOR_S));
+            gnome_cmd_con_set_base_path(con, uriPath && strlen(uriPath) > 0
+                ? new GnomeCmdPlainPath(uriPath)
+                : new GnomeCmdPlainPath(G_DIR_SEPARATOR_S));
             gnome_cmd_con_set_root_path(con, uriPath);
             gnome_cmd_con_set_host_name (con, uriHost);
             if (uriPort != -1)
@@ -571,7 +573,9 @@ gboolean gnome_cmd_connect_dialog_edit (GnomeCmdConRemote *server)
             auto portChar = gtk_entry_get_text (GTK_ENTRY (dialog->priv->port_entry));
             port = portChar ? atoi(portChar) : -1;
 
-            gnome_cmd_con_set_base_path(con, path ? new GnomeCmdPlainPath(path) : new 
GnomeCmdPlainPath(G_DIR_SEPARATOR_S));
+            gnome_cmd_con_set_base_path(con, path && strlen(path) > 0
+                ? new GnomeCmdPlainPath(path)
+                : new GnomeCmdPlainPath(G_DIR_SEPARATOR_S));
             gnome_cmd_con_set_root_path(con, path);
             gnome_cmd_con_set_host_name (con, host);
             if (port != -1)


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