summaryrefslogtreecommitdiffstats
path: root/src/portable.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-07-17 17:11:58 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2018-07-17 17:11:58 (GMT)
commita05532d8532f5f71e1ae7ff4d383102ee91cd17c (patch)
treed224e981a1ae650b290c66e345484bb31e56385b /src/portable.cpp
parent400b3168c2ca7b113331af2bd5e96092354b8724 (diff)
parentc8ff40b37ca811e207968b70b7c60cbb7dd58596 (diff)
downloadDoxygen-a05532d8532f5f71e1ae7ff4d383102ee91cd17c.zip
Doxygen-a05532d8532f5f71e1ae7ff4d383102ee91cd17c.tar.gz
Doxygen-a05532d8532f5f71e1ae7ff4d383102ee91cd17c.tar.bz2
Merge branch 'feature/bug_extcmd_path' of https://github.com/albert-github/doxygen into albert-github-feature/bug_extcmd_path
Diffstat (limited to 'src/portable.cpp')
-rw-r--r--src/portable.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/portable.cpp b/src/portable.cpp
index 4ad88a4..224266a 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -35,7 +35,21 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
if (command==0) return 1;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ const char *p = command;
+ char *q = (char *)malloc(strlen(p) + 1);
+ strcpy(q, p);
+ for (int i = 0 ; i < strlen(q); i++)
+ {
+ if (q[i] == '/')
+ {
+ q[i] = '\\';
+ }
+ }
+ QCString fullCmd=q;
+#else
QCString fullCmd=command;
+#endif
fullCmd=fullCmd.stripWhiteSpace();
if (fullCmd.at(0)!='"' && fullCmd.find(' ')!=-1)
{
@@ -122,6 +136,7 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
#else // Win32 specific
if (commandHasConsole)
{
+ free(q);
return system(fullCmd);
}
else
@@ -134,7 +149,7 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
// For that case COM is initialized as follows
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
- QString commandw = QString::fromUtf8( command );
+ QString commandw = QString::fromUtf8( q );
QString argsw = QString::fromUtf8( args );
// gswin32 is a GUI api which will pop up a window and run
@@ -161,6 +176,7 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
NULL, /* ignored: icon */
NULL /* resulting application handle */
};
+ free(q);
if (!ShellExecuteExW(&sInfo))
{