diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-10-12 14:48:19 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-10-12 14:48:19 +0200 |
commit | 0913e968f59aed413dcb9bc5e392a554e2711ad7 (patch) | |
tree | 05503f96b9febd326b9669f956870a6c9684fc35 /kernel | |
parent | 2fdb3a4a91e2dc07f9aa75c478c6b8bfa1d1eb19 (diff) | |
download | yosys-0913e968f59aed413dcb9bc5e392a554e2711ad7.tar.gz yosys-0913e968f59aed413dcb9bc5e392a554e2711ad7.tar.bz2 yosys-0913e968f59aed413dcb9bc5e392a554e2711ad7.zip |
More win32/abc fixes
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/yosys.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc index fa14c5d9a..e50bfcbe6 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -473,12 +473,14 @@ std::string proc_self_dirname() #elif defined(_WIN32) std::string proc_self_dirname() { - char path[MAX_PATH+1]; - if (!GetModuleFileName(0, path, MAX_PATH+1)) + char longpath[MAX_PATH+1], shortpath[MAX_PATH+1]; + if (!GetModuleFileName(0, longpath, MAX_PATH+1)) log_error("GetModuleFileName() failed.\n"); - for (int i = strlen(path)-1; i >= 0 && path[i] != '/' && path[i] != '\\' ; i--) - path[i] = 0; - return std::string(path); + if (!GetShortPathName(longpath, shortpath, MAX_PATH+1)) + log_error("GetShortPathName() failed.\n"); + for (int i = strlen(shortpath)-1; i >= 0 && shortpath[i] != '/' && shortpath[i] != '\\' ; i--) + shortpath[i] = 0; + return std::string(shortpath); } #elif defined(EMSCRIPTEN) std::string proc_self_dirname() |