File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -11862,6 +11862,7 @@ void generateOutput()
11862
11862
g_s.begin (" Running html help compiler...\n " );
11863
11863
QString oldDir = QDir::currentDirPath ();
11864
11864
QDir::setCurrent (Config_getString (HTML_OUTPUT));
11865
+ portable_setShortDir ();
11865
11866
portable_sysTimerStart ();
11866
11867
if (portable_system (Config_getString (HHC_LOCATION), " index.hhp" , Debug::isFlagSet (Debug::ExtCmd))!=1 )
11867
11868
{
Original file line number Diff line number Diff line change @@ -478,3 +478,20 @@ void portable_unlink(const char *fileName)
478
478
#endif
479
479
}
480
480
481
+ void portable_setShortDir (void )
482
+ {
483
+ #if defined(_WIN32) && !defined(__CYGWIN__)
484
+ long length = 0 ;
485
+ TCHAR* buffer = NULL ;
486
+ // First obtain the size needed by passing NULL and 0.
487
+ length = GetShortPathName (QDir::currentDirPath ().data (), NULL , 0 );
488
+ // Dynamically allocate the correct size
489
+ // (terminating null char was included in length)
490
+ buffer = new TCHAR[length];
491
+ // Now simply call again using same (long) path.
492
+ length = GetShortPathName (QDir::currentDirPath ().data (), buffer, length);
493
+ // Set the correct directory (short name)
494
+ QDir::setCurrent (buffer);
495
+ delete [] buffer;
496
+ #endif
497
+ }
Original file line number Diff line number Diff line change 4
4
#include <sys/types.h>
5
5
#include <stdio.h>
6
6
#include <qglobal.h>
7
+ #include <qdir.h>
7
8
8
9
#if defined(_WIN32 )
9
10
typedef __int64 portable_off_t ;
@@ -37,6 +38,7 @@ double portable_getSysElapsedTime();
37
38
void portable_sleep (int ms );
38
39
bool portable_isAbsolutePath (const char * fileName );
39
40
void portable_correct_path (void );
41
+ void portable_setShortDir (void );
40
42
41
43
extern "C" {
42
44
void * portable_iconv_open (const char * tocode , const char * fromcode );
You can’t perform that action at this time.
0 commit comments