Implement handling of current working directory in Windows FSNode class.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2510 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-05-28 19:25:57 +00:00
parent b0c1fb9d9f
commit 5bd54cb684
1 changed files with 11 additions and 3 deletions

View File

@ -247,10 +247,18 @@ WindowsFilesystemNode::WindowsFilesystemNode(const string& p)
// Expand '.\' to the current working directory, // Expand '.\' to the current working directory,
// likewise if the path is relative (second character not a colon) // likewise if the path is relative (second character not a colon)
else if ((p.length() >= 2 && ((p[0] == '.' && p[1] == '\\') || else if ((p.length() >= 2 && ((p[0] == '.' && p[1] == '\\') ||
p[1] != ':')) p[1] != ':')))
{ {
// TODO - implement this char buf[4096];
_path = p; if(GetCurrentDirectory(4096, buf) > 0)
_path = buf;
if(p[0] == '.')
// Skip over the tilde/dot. We know that p contains at least
// two chars, so this is safe:
_path = _path + (p.c_str() + 1);
else
_path = _path + '\\' + p;
} }
else else
{ {