summaryrefslogtreecommitdiffstats
path: root/testProcess.c
diff options
context:
space:
mode:
authorKWSys Robot <kwrobot@kitware.com>2014-07-18 12:32:24 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-18 14:15:20 (GMT)
commitd4d1b7f7d1d6592f12a6692dfb8068aa495bd454 (patch)
tree9f4a7d7bacb149276334e8e7afadafb91c7f5e2f /testProcess.c
parent3d127627f8e28d97ecc44515e274b3780ae3f4b9 (diff)
downloadCMake-d4d1b7f7d1d6592f12a6692dfb8068aa495bd454.zip
CMake-d4d1b7f7d1d6592f12a6692dfb8068aa495bd454.tar.gz
CMake-d4d1b7f7d1d6592f12a6692dfb8068aa495bd454.tar.bz2
KWSys 2014-07-18 (65b36ede)
Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 65b36ede | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' c2a329ce..65b36ede Bob E (1): 697b1401 SystemInformation: No SA_RESTART on QNX Clinton Stimpson (1): 65b36ede Encoding: Fix testProcess to work with unicode paths. Steve Dougherty (1): 5f28a52b Terminal: Fix spelling of 'definitely' in comments Change-Id: I224745dc0ca9603ff915b727e798ef293c462d8f
Diffstat (limited to 'testProcess.c')
-rw-r--r--testProcess.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/testProcess.c b/testProcess.c
index 6d5eb71..3d62822 100644
--- a/testProcess.c
+++ b/testProcess.c
@@ -11,11 +11,13 @@
============================================================================*/
#include "kwsysPrivate.h"
#include KWSYS_HEADER(Process.h)
+#include KWSYS_HEADER(Encoding.h)
/* Work-around CMake dependency scanning limitation. This must
duplicate the above list of headers. */
#if 0
# include "Process.h.in"
+# include "Encoding.h.in"
#endif
#include <stdio.h>
@@ -393,6 +395,19 @@ int runChild(const char* cmd[], int state, int exception, int value,
int main(int argc, const char* argv[])
{
int n = 0;
+
+#ifdef _WIN32
+ int i;
+ char new_args[10][_MAX_PATH];
+ LPWSTR* w_av = CommandLineToArgvW(GetCommandLineW(), &argc);
+ for(i=0; i<argc; i++)
+ {
+ kwsysEncoding_wcstombs(new_args[i], w_av[i], _MAX_PATH);
+ argv[i] = new_args[i];
+ }
+ LocalFree(w_av);
+#endif
+
#if 0
{
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);