diff options
Diffstat (limited to 'src/env.cpp')
-rw-r--r-- | src/env.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/env.cpp b/src/env.cpp index c24280bc..56c9deb0 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -377,14 +377,13 @@ static void setup_path() int env_set_pwd() { - wchar_t dir_path[4096]; - wchar_t *res = wgetcwd(dir_path, 4096); - if (!res) + wcstring res = wgetcwd(); + if (res.empty()) { debug(0, _(L"Could not determine current working directory. Is your locale set correctly?")); return 0; } - env_set(L"PWD", dir_path, ENV_EXPORT | ENV_GLOBAL); + env_set(L"PWD", res.c_str(), ENV_EXPORT | ENV_GLOBAL); return 1; } |