| 312 | KWSYS_NAMESPACE::Encoding::ToWindowsExtendedPath(dir).c_str()); |
| 313 | } |
| 314 | inline char const* Getcwd(char* buf, unsigned int len) |
| 315 | { |
| 316 | std::vector<wchar_t> w_buf(len); |
| 317 | if (_wgetcwd(&w_buf[0], len)) { |
| 318 | size_t nlen = kwsysEncoding_wcstombs(buf, &w_buf[0], len); |
| 319 | if (nlen == static_cast<size_t>(-1)) { |
| 320 | return 0; |
| 321 | } |
| 322 | if (nlen < len) { |
| 323 | // make sure the drive letter is capital |
| 324 | if (nlen > 1 && buf[1] == ':') { |
| 325 | buf[0] = kwsysString_toupper(buf[0]); |
| 326 | } |
| 327 | return buf; |
| 328 | } |
| 329 | } |
| 330 | return 0; |
| 331 | } |
| 332 | inline int Chdir(std::string const& dir) |
| 333 | { |
| 334 | // We cannot use ToWindowsExtendedPath here because that causes a |
no test coverage detected
searching dependent graphs…