[gnome-commander] Add a directory separator when trying to copy a file and it is missing
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Add a directory separator when trying to copy a file and it is missing
- Date: Thu, 6 Jan 2022 22:27:54 +0000 (UTC)
commit 6f903756d61d0088c53985ea5d6e25425fbc24bc
Author: Uwe Scholz <u scholz83 gmx de>
Date: Thu Jan 6 23:14:53 2022 +0100
Add a directory separator when trying to copy a file and it is missing
src/dialogs/gnome-cmd-prepare-xfer-dialog.cc | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/dialogs/gnome-cmd-prepare-xfer-dialog.cc b/src/dialogs/gnome-cmd-prepare-xfer-dialog.cc
index adba7122..7d67cb3b 100644
--- a/src/dialogs/gnome-cmd-prepare-xfer-dialog.cc
+++ b/src/dialogs/gnome-cmd-prepare-xfer-dialog.cc
@@ -89,7 +89,17 @@ static void on_ok (GtkButton *button, GnomeCmdPrepareXferDialog *dialog)
if (!gnome_cmd_dir_is_local (dialog->default_dest_dir))
{
const gchar *t = gnome_cmd_dir_get_path (dialog->default_dest_dir)->get_path();
- dest_path = g_build_filename (t, user_path, nullptr);
+ auto destPathTmp = g_build_filename (t, user_path, nullptr);
+ if (*destPathTmp != '/')
+ {
+ dest_path = g_strdup_printf("%s%s", G_DIR_SEPARATOR_S, destPathTmp);
+ g_free(destPathTmp);
+ }
+ else
+ {
+ dest_path = destPathTmp;
+ }
+
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]