summaryrefslogtreecommitdiffstats
path: root/src/portable.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-11-16 14:50:36 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-11-16 14:50:36 (GMT)
commit8608a9e74ca3e375ef07dce419d6f2cf859bfebf (patch)
treedd8d25830176e888df2e7acf2da1936f4acfcc15 /src/portable.cpp
parent7acba2f316a6e8f02364d76ab96b7ff9e739aec1 (diff)
parent18a5a679f57ac922183bc1800692d40c2872231f (diff)
downloadDoxygen-8608a9e74ca3e375ef07dce419d6f2cf859bfebf.zip
Doxygen-8608a9e74ca3e375ef07dce419d6f2cf859bfebf.tar.gz
Doxygen-8608a9e74ca3e375ef07dce419d6f2cf859bfebf.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src/portable.cpp')
-rw-r--r--src/portable.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/portable.cpp b/src/portable.cpp
index c6e829d..b447adc 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -478,3 +478,20 @@ void portable_unlink(const char *fileName)
#endif
}
+void portable_setShortDir(void)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ long length = 0;
+ TCHAR* buffer = NULL;
+ // First obtain the size needed by passing NULL and 0.
+ length = GetShortPathName(QDir::currentDirPath().data(), NULL, 0);
+ // Dynamically allocate the correct size
+ // (terminating null char was included in length)
+ buffer = new TCHAR[length];
+ // Now simply call again using same (long) path.
+ length = GetShortPathName(QDir::currentDirPath().data(), buffer, length);
+ // Set the correct directory (short name)
+ QDir::setCurrent(buffer);
+ delete [] buffer;
+#endif
+}