Permalink
Browse files

Bugfix: the command line is empty and does not contain the name of th…

…e executable
  • Loading branch information...
1 parent 41143a2 commit 03e3dd6d4bf908e39864c8056e1cd7dc087d3e7b @tim-lebedkov committed Sep 15, 2014
Showing with 15 additions and 2 deletions.
  1. +1 −1 exeproxy/Makefile
  2. +14 −1 exeproxy/src/main.c
View
@@ -41,7 +41,7 @@ AI=$(shell "$(NPACKD_CL)\npackdcl.exe" "path" "--package=com.advancedinstaller.A
SEVENZIP=$(shell "$(NPACKD_CL)\npackdcl.exe" "path" "--package=org.7-zip.SevenZIP" "--versions=[9, 10$(RPAREN)")
MINGWUTILS=$(shell "$(NPACKD_CL)\npackdcl.exe" "path" "--package=org.mingw.MinGWUtilities" "--versions=[0.3, 0.3]")
PUTTY=$(shell "$(NPACKD_CL)\npackdcl.exe" "path" "--package=uk.org.greenend.chiark.sgtatham.Putty" "--versions=[0.62, 2$(RPAREN)")
-VERSION=0.1
+VERSION=0.2
all:
$(MAKE) clean PROFILE=release32
View
@@ -165,6 +165,18 @@ int wmain(int argc, wchar_t **argv)
free(target);
+ wchar_t* cmdLine = 0;
+ if (!ret) {
+ cmdLine = malloc((wcslen(newExe) + wcslen(args) + 4) * sizeof(wchar_t));
+ wcscpy(cmdLine, L"\"");
+ wcscat(cmdLine, newExe);
+ wcscat(cmdLine, L"\"");
+ if (wcslen(args) > 0) {
+ wcscat(cmdLine, L" ");
+ wcscat(cmdLine, args);
+ }
+ }
+
if (!ret) {
PROCESS_INFORMATION pinfo;
@@ -176,7 +188,7 @@ int wmain(int argc, wchar_t **argv)
};
WINBOOL success = CreateProcess(
newExe,
- args,
+ cmdLine,
0, 0, TRUE,
CREATE_UNICODE_ENVIRONMENT, 0,
0, &startupInfo, &pinfo);
@@ -196,6 +208,7 @@ int wmain(int argc, wchar_t **argv)
}
}
+ free(cmdLine);
free(exe);
free(newExe);
free(args);

0 comments on commit 03e3dd6

Please sign in to comment.