From c4068e61967748f8b57a7c340b4bc95fae6e6752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 6 Apr 2024 20:34:27 +0100 Subject: [PATCH] general: Don't treat root directory as separator This partially reverts commit c5216c47da5c5792b03df41aadd1190fac5a4823 G_DIR_SEPARATOR_S exists primarily as convenience to make GLib-based code portable to Microsoft Windows, which is not relevant to this app. We can still use it anyway when we want to be clear that a slash is being used as a dir separator. The root directory's path is "/". While that's the exact same character as a directory separator, its meaning is completely different. --- src/nautilus-file-operations.c | 2 +- src/nautilus-window.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index 625ac7529..b263f2107 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -6392,7 +6392,7 @@ get_abs_path_for_symlink (GFile *file, relative = g_file_get_relative_path (root, file); g_object_unref (root); - abs = g_strconcat (G_DIR_SEPARATOR_S, relative, NULL); + abs = g_strconcat ("/", relative, NULL); g_free (relative); return abs; } diff --git a/src/nautilus-window.c b/src/nautilus-window.c index aedff5ea4..0f6b5eff9 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -408,7 +408,7 @@ action_prompt_for_location_root (GSimpleAction *action, GVariant *state, gpointer user_data) { - prompt_for_location (NAUTILUS_WINDOW (user_data), G_DIR_SEPARATOR_S); + prompt_for_location (NAUTILUS_WINDOW (user_data), "/"); } static void