Kaydet (Commit) 13597df9 authored tarafından Nick Treleaven's avatar Nick Treleaven

Convert Unix path separators on Windows when opening documents

Unix path separators can occur e.g. when using MSYS.
Windows does not allow filenames to contain Unix path separators so
this should be safe.
üst 5f0e46e0
......@@ -1903,6 +1903,10 @@ void utils_tidy_path(gchar *filename)
if (str->len >= 2 && strncmp(str->str, "\\\\", 2) == 0)
preserve_double_backslash = TRUE;
#ifdef G_OS_WIN32
/* using MSYS we can get Unix-style separators */
utils_string_replace_all(str, "/", G_DIR_SEPARATOR_S);
#endif
/* replace "/./" and "//" */
utils_string_replace_all(str, G_DIR_SEPARATOR_S "." G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S);
utils_string_replace_all(str, G_DIR_SEPARATOR_S G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment