general: Don't treat root directory as separator

This partially reverts commit c5216c47da

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.
This commit is contained in:
António Fernandes 2024-04-06 20:34:27 +01:00 committed by Peter Eisenmann
parent c1646b3411
commit c4068e6196
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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