@ -940,6 +940,7 @@ if {$nextshelltype ne "tcl" && $nextshelltype ne "none"} {
#maint: keep this munging in sync with zsh/bash and perl blocks which must also do msys mangling
#maint: keep this munging in sync with zsh/bash and perl blocks which must also do msys mangling
if {[regexp{^cmd$|^cmd[.]exe$}$cmdword]}{
if {[regexp{^cmd$|^cmd[.]exe$}$cmdword]}{
#need to deal with msys argument munging
#need to deal with msys argument munging
puts stderr "cmd call via msys detected. performing translation of /c to //C"
#for now we only deal with /C or /c - todo - other cmd.exe flags?
#for now we only deal with /C or /c - todo - other cmd.exe flags?
#In this context we would usually only be using cmd.exe /c to launch older 'desktop' powershell to avoid spaced-argument problems - so we aren't expecting other flags
#In this context we would usually only be using cmd.exe /c to launch older 'desktop' powershell to avoid spaced-argument problems - so we aren't expecting other flags
setnew_nextshellpath [list $cmdword]
setnew_nextshellpath [list $cmdword]
@ -1236,13 +1237,14 @@ if [[ "$nextshelltype" != "bash" && "$nextshelltype" != "none" ]]; then
#do not double quote cmdpattern - or it will be treated as literal string
#do not double quote cmdpattern - or it will be treated as literal string
if [["$nextshellpath"=~$cmdpattern]];then
if [["$nextshellpath"=~$cmdpattern]];then
#for now - tell the user what's going on
#for now - tell the user what's going on
echo"cmd call via msys detected. performing translation of /c to //c and escaping backslashes in script path"
echo"cmd call via msys detected. performing translation of /c to //c and escaping backslashes in script path">&2
#flags to cmd.exe such as /c are interpreted by msys as looking like a unix path
#flags to cmd.exe such as /c are interpreted by msys as looking like a unix path
#review - for nextshellpath targets specified in the block for win32 - we don't expect unix paths (?)
#review - for nextshellpath targets specified in the block for win32 - we don't expect unix paths (?)
#what about other flags? - can we just double up all forward slashes?
#what about other flags? - can we just double up all forward slashes?
#maint: keep this munging in sync with the tcl block and perl block which must also do msys munging
#maint: keep this munging in sync with the tcl block and perl block which must also do msys munging