File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ Date: January 2012
50
50
// / \return current working directory
51
51
std::string get_current_working_directory ()
52
52
{
53
- #ifndef _WIN32
53
+ #ifndef _WIN32
54
54
errno=0 ;
55
55
char *wd=realpath (" ." , nullptr );
56
56
@@ -60,13 +60,19 @@ std::string get_current_working_directory()
60
60
61
61
std::string working_directory=wd;
62
62
free (wd);
63
- #else
64
- char buffer[4096 ];
63
+ #else
64
+ TCHAR buffer[4096 ];
65
65
DWORD retval=GetCurrentDirectory (4096 , buffer);
66
66
if (retval == 0 )
67
67
throw system_exceptiont (" failed to get current directory of process" );
68
+
69
+ # ifdef UNICODE
70
+ std::string working_directory (narrow (buffer));
71
+ # else
68
72
std::string working_directory (buffer);
69
- #endif
73
+ # endif
74
+
75
+ #endif
70
76
71
77
return working_directory;
72
78
}
You can’t perform that action at this time.
0 commit comments