diff options
author | Chris Wilson <chris+github@qwirx.com> | 2006-09-03 22:54:58 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2006-09-03 22:54:58 +0000 |
commit | 054f818ce7f7d9e274da16b5ab6956792fa1b986 (patch) | |
tree | da34dc8e129cf01b6104c0db1387e5750b56a483 /lib/win32 | |
parent | 309f2d0428db81ea8bf9762e276de2458ce1d125 (diff) |
(refs #3)
Convert UNIX to native paths
Diffstat (limited to 'lib/win32')
-rw-r--r-- | lib/win32/emu.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp index fa853f14..37699bb1 100644 --- a/lib/win32/emu.cpp +++ b/lib/win32/emu.cpp @@ -436,13 +436,26 @@ bool ConvertConsoleToUtf8(const char* pString, std::string& rDest) // -------------------------------------------------------------------------- std::string ConvertPathToAbsoluteUnicode(const char *pFileName) { + std::string filename; + for (int i = 0; pFileName[i] != 0; i++) + { + if (pFileName[i] == '/') + { + filename += '\\'; + } + else + { + filename += pFileName[i]; + } + } + std::string tmpStr("\\\\?\\"); // Is the path relative or absolute? // Absolute paths on Windows are always a drive letter // followed by ':' - if (pFileName[1] != ':') + if (filename.length() >= 2 && filename[1] != ':') { // Must be relative. We need to get the // current directory to make it absolute. @@ -465,7 +478,7 @@ std::string ConvertPathToAbsoluteUnicode(const char *pFileName) } } - tmpStr += pFileName; + tmpStr += filename; return tmpStr; } |