Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
win32: Fix command execution without vimrun.exe
`:help win32-vimrun` says that: > If "vimrun" cannot be found, the command is executed directly, but > then the DOS window closes immediately after the external command > has finished. This implies that external commands can be executed even without vimrun.exe. However, currently `:echo system('dir')` causes E484 if vimrun.exe doesn't exist. The vimrun.exe itself uses `_wsystem()` to execute the external command. It means that the command line is parsed twice by cmd.exe; first by `cmd /c` because of the 'shell' and 'shellcmdflag' options, second by _wsystem() in vimrun.exe. However, if the vimrun.exe doesn't exists, the command line is parsed only once. This difference caused the E484 error. An easy way to fix this is using `cmd /c cmd /c` to execute external commands if the vimrun.exe doesn't exist. The command line is parsed twice by cmd, so the problem doesn't occur.
- Loading branch information