--- a/Win32OperatingSystem.st Wed Oct 05 14:31:01 2016 +0200
+++ b/Win32OperatingSystem.st Wed Oct 05 14:45:19 2016 +0200
@@ -3552,15 +3552,19 @@
commandAndArgsForOSCommand:aCommandString
"get a shell and shell arguments for command execution.
If aCommandString is a String, the commandString is passed to a shell for execution
- - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
+ - see the description of 'sh -c' in your UNIX manual ('cmd.exe' in your Windows manual).
If aCommandString is an Array, the first element is the command to be executed,
- and the other elements are the arguments to the command. No shell is invoked in this case."
+ and the next elements are the arguments to the command. No shell is invoked in this case.
+ Answer am Array with the command string as the first element,
+ the arguments (a String) as second element,
+ and whether a window should be opened (true, false or nil = let the executed program determine)
+ as third element."
|shell args wDir cmdName path hasRedirection|
aCommandString isNonByteCollection ifTrue:[
"easy: the caller does not want a shell to be executed"
- ^ Array with:aCommandString first with:(aCommandString asStringWith:' ').
+ ^ Array with:aCommandString first with:(aCommandString asStringWith:' ') with:nil.
].
"/
@@ -3612,13 +3616,13 @@
(file exists and:[suffix = 'exe' or:[suffix = 'com']]) ifTrue:[
"/ is an executable, no shell required
path := file fullAlternativePathName.
- ^ Array with:path with:aCommandString.
+ ^ Array with:path with:aCommandString with:nil.
"/ ^ Array with:path with:(path, ' ', args).
].
path := self pathOfCommand:cmdName.
path notNil ifTrue:[
"/ is an executable, no shell required
- ^ Array with:path with:aCommandString.
+ ^ Array with:path with:aCommandString with:nil.
"/ ^ Array with:path with:(path, ' ', args).
].
].
@@ -3636,10 +3640,10 @@
].
aCommandString isEmptyOrNil ifTrue:[
- ^ Array with:shell with:nil
- ].
-
- ^ Array with:shell with:(' /c "' , aCommandString, '"')
+ ^ Array with:shell with:nil with:nil.
+ ].
+
+ ^ Array with:shell with:(' /c "' , aCommandString, '"') with:false.
"
self commandAndArgsForOSCommand:'diff'
@@ -4495,7 +4499,7 @@
fork:true
newPgrp:true
inDirectory:dir
- showWindow:showWindowBooleanOrNil.
+ showWindow:(shellAndArgs at:3).
nullStream notNil ifTrue:[
nullStream close.