Do not mangle \\... paths

This commit is contained in:
Yevgen Muntyan 2008-01-17 19:27:10 -06:00
parent 234309f31a
commit 193ba1adc8
2 changed files with 6 additions and 2 deletions

View File

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

View File

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