aboutsummaryrefslogtreecommitdiff
path: root/butl/path.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-01 12:32:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-01 12:32:47 +0200
commitec5b8d561277b2a4b0ad02aa7f936d4d4b20c35f (patch)
tree5902085f0a9b6088658b606e2c66f27c2a36beab /butl/path.cxx
parentefb5db56425245a20df704e707f6a91190eb67f3 (diff)
Make sure current directory drive letter is upper case
Fun fact: _getcwd() returns upper under Wine and lower on Windows 7.
Diffstat (limited to 'butl/path.cxx')
-rw-r--r--butl/path.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/butl/path.cxx b/butl/path.cxx
index d7a0da9..03d4b1f 100644
--- a/butl/path.cxx
+++ b/butl/path.cxx
@@ -66,6 +66,7 @@ namespace butl
char cwd[_MAX_PATH];
if (_getcwd (cwd, _MAX_PATH) == 0)
throw system_error (errno, system_category ());
+ cwd[0] = toupper (cwd[0]); // Canonicalize.
#else
char cwd[PATH_MAX];
if (getcwd (cwd, PATH_MAX) == 0)
@@ -228,6 +229,7 @@ namespace butl
wchar_t wcwd[_MAX_PATH];
if (_wgetcwd (wcwd, _MAX_PATH) == 0)
throw system_error (errno, system_category ());
+ wcwd[0] = toupper (wcwd[0]); // Canonicalize.
#else
char cwd[PATH_MAX];
if (getcwd (cwd, PATH_MAX) == 0)