diff options
Diffstat (limited to 'lldb/source/Host/windows/Windows.cpp')
-rw-r--r-- | lldb/source/Host/windows/Windows.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/lldb/source/Host/windows/Windows.cpp b/lldb/source/Host/windows/Windows.cpp index 21afc6d85da..ee965e78603 100644 --- a/lldb/source/Host/windows/Windows.cpp +++ b/lldb/source/Host/windows/Windows.cpp @@ -23,10 +23,9 @@ #include <stdlib.h> #include <string.h> -// These prototypes are defined in <direct.h>, but it also defines chdir() and -// getcwd(), giving multiply defined errors +// These prototypes are defined in <direct.h>, but it also defines chdir(), +// giving multiply defined errors extern "C" { -char *_getcwd(char *buffer, int maxlen); int _chdir(const char *path); } @@ -190,28 +189,6 @@ char *basename(char *path) { return &l1[1]; } -// use _getcwd() instead of GetCurrentDirectory() because it updates errno -char *getcwd(char *path, int max) { - assert(path == NULL || max <= PATH_MAX); - wchar_t wpath[PATH_MAX]; - if (wchar_t *wresult = _wgetcwd(wpath, PATH_MAX)) { - // Caller is allowed to pass in NULL for `path`. - // In that case, we're supposed to allocate a - // buffer on the caller's behalf. - if (path == NULL) { - max = UNI_MAX_UTF8_BYTES_PER_CODE_POINT * wcslen(wresult) + 1; - path = (char *)malloc(max); - if (path == NULL) { - errno = ENOMEM; - return NULL; - } - } - if (wideToUtf8(wresult, path, max)) - return path; - } - return NULL; -} - // use _chdir() instead of SetCurrentDirectory() because it updates errno int chdir(const char *path) { return _chdir(path); } |