summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-09-03 22:54:58 +0000
committerChris Wilson <chris+github@qwirx.com>2006-09-03 22:54:58 +0000
commit054f818ce7f7d9e274da16b5ab6956792fa1b986 (patch)
treeda34dc8e129cf01b6104c0db1387e5750b56a483 /lib
parent309f2d0428db81ea8bf9762e276de2458ce1d125 (diff)
(refs #3)
Convert UNIX to native paths
Diffstat (limited to 'lib')
-rw-r--r--lib/win32/emu.cpp17
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;
}