From ec5b8d561277b2a4b0ad02aa7f936d4d4b20c35f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 1 Aug 2016 12:32:47 +0200 Subject: Make sure current directory drive letter is upper case Fun fact: _getcwd() returns upper under Wine and lower on Windows 7. --- butl/path.cxx | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.1