diff --git a/moo/moofileview/moofilesystem.c b/moo/moofileview/moofilesystem.c index 69d06430..7b85b76c 100644 --- a/moo/moofileview/moofilesystem.c +++ b/moo/moofileview/moofilesystem.c @@ -999,6 +999,7 @@ normalize_path_win32 (G_GNUC_UNUSED MooFileSystem *fs, { char *drive, *path, *normpath; guint slashes; + gboolean drive_slashes = FALSE; g_return_val_if_fail (fullpath != NULL, NULL); @@ -1020,6 +1021,7 @@ normalize_path_win32 (G_GNUC_UNUSED MooFileSystem *fs, drive = g_strndup (path, slashes); path = g_strdup (tmp + slashes); g_free (tmp); + drive_slashes = TRUE; } // else if (path[0] == '\\') // { @@ -1046,7 +1048,7 @@ normalize_path_win32 (G_GNUC_UNUSED MooFileSystem *fs, { char *tmp = normpath; - if (normpath[0] == '\\') + if (normpath[0] == '\\' || drive_slashes) normpath = g_strdup_printf ("%s%s", drive, normpath); else normpath = g_strdup_printf ("%s\\%s", drive, normpath); diff --git a/moo/mooutils/mooutils-fs.c b/moo/mooutils/mooutils-fs.c index 82654031..5e649e32 100644 --- a/moo/mooutils/mooutils-fs.c +++ b/moo/mooutils/mooutils-fs.c @@ -639,6 +639,7 @@ normalize_full_path (const char *fullpath, char *drive, *path, *normpath; guint slashes; guint len; + gboolean drive_slashes = FALSE; g_return_val_if_fail (fullpath != NULL, NULL); @@ -660,6 +661,7 @@ normalize_full_path (const char *fullpath, drive = g_strndup (path, slashes); path = g_strdup (tmp + slashes); g_free (tmp); + drive_slashes = TRUE; } #if 0 // else if (path[0] == '\\') @@ -688,7 +690,7 @@ normalize_full_path (const char *fullpath, { char *tmp = normpath; - if (normpath[0] == '\\') + if (normpath[0] == '\\' || drive_slashes) normpath = g_strdup_printf ("%s%s", drive, normpath); else normpath = g_strdup_printf ("%s\\%s", drive, normpath);