summaryrefslogtreecommitdiffstats
path: root/src/portable.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-11-15 14:39:42 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-11-15 14:39:42 (GMT)
commit4d173a0b2e13b2cd26c996894480afc65d50cd87 (patch)
tree1c30fa50c46e611d54ab61d0c45cd13e57abd69e /src/portable.cpp
parentd4a0825b1d00ead2ce441c3407d1983f80401353 (diff)
downloadDoxygen-4d173a0b2e13b2cd26c996894480afc65d50cd87.zip
Doxygen-4d173a0b2e13b2cd26c996894480afc65d50cd87.tar.gz
Doxygen-4d173a0b2e13b2cd26c996894480afc65d50cd87.tar.bz2
HHC and directory elements starting with "."
Based on the question 'Doxygen failed to run html help compiler, hhc.exe error HHC5010 when running from folder that has a parent folder that starts with “.”/ (https://stackoverflow.com/questions/58861908/doxygen-failed-to-run-html-help-compiler-hhc-exe-error-hhc5010-when-running-fro). In we https://social.msdn.microsoft.com/Forums/en-US/0681145c-223b-498c-b7bf-be83209cbf4e/issue-with-html-workshop-in-a-windows-container?forum=visualstudiogeneral see: HTML Help 1.x command line compiler hhc.exe cannot compile CHM file to folder whose full path contains folder name starting with dot. If you have that problem, you probably specified output path with folder starting with dot, e.g. "d:\My files.NET\documentation". You can use dots in folder names but not at the beginning. We first convert the current path to a short name path and set this as current directory, this is only done on Windows other systems are not touched.
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
+}