diff options
author | Marius Kintel <marius@kintel.net> | 2014-02-06 05:44:03 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2014-02-06 05:44:03 (GMT) |
commit | 55192e46a4c0a977b7a9a35650b027c7a410ab14 (patch) | |
tree | 994b200e7bf1db3f789f4ff386ead01333e240eb /src/winconsole.c | |
parent | 57e2ecd7b5fd64c7a325ea8816c6f0df4dd63e08 (diff) |
Backported 2e3729ab2268f29ee4ff5898f629c4a10c2d6587 to master; redo assemblePath for Win. redo openscad.com to handle spaces in filenames
Diffstat (limited to 'src/winconsole.c')
-rw-r--r-- | src/winconsole.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/winconsole.c b/src/winconsole.c index de8e682..11a0309 100644 --- a/src/winconsole.c +++ b/src/winconsole.c @@ -40,16 +40,24 @@ int main( int argc, char * argv[] ) int eof = 0; int pclose_result; int i; + const char * argchar; int result = 0; + int quotify_arg = 0; strcat( cmd, "\0" ); strcat( cmd, "openscad.exe" ); for ( i = 1 ; i < argc ; ++i ) { + quotify_arg = 0; + for ( argchar = argv[i]; *argchar!=0; argchar++ ) { + if ((char)(*argchar)==' ') quotify_arg = 1; + } strcat( cmd, " " ); + if (quotify_arg) strcat( cmd, "\""); strcat( cmd, argv[i] ); + if (quotify_arg) strcat( cmd, "\""); } - strcat( cmd, " "); strcat( cmd, " 2>&1"); // capture stderr and stdout + printf("openscad.com: running command: %s\n", cmd ); cmd_stdout = _popen( cmd, "rt" ); if ( cmd_stdout == NULL ) { |