Hi all >> If I do :!dir a console opens and says: >> C:\WINNT\system32\CMD.EXE /c dir >> shell returned -1 >> > > 2) If 1) doesn't help, you may want to produce the phenomena outside > of vim. Open a cmd-window and type something like > > "path\to\vim\vimrun.exe" %windir%\system32\cmd.exe /c dir > Juan told me he could reproduce the error outside of vim like that. I then consulted
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_system.2c_._wsystem.asp and saw that vimrun.exe doesn't issue the full information of the error if the system() function call returns -1. This is why I suggest the following patch: Patch Problem: On Windows, vimrun.exe doesn't report the error correctly if the system() function call returns -1. Solution: Use perror() in this case Files: src/vimrun.c *** ..\vim-7.0.000\src\vimrun.c 2006-05-07 16:13:04.000000000 +0200 --- src\vimrun.c 2006-05-28 15:26:15.784252200 +0200 *************** *** 99,106 **** */ retval = system(p); ! if (retval != 0) ! printf("shell returned %d\n", retval); if (!silent) { --- 99,110 ---- */ retval = system(p); ! if (retval == -1) { ! perror("system(): "); ! } ! else if (retval != 0) { ! printf("shell returned %d\n", retval); ! } if (!silent) { -- Greetings Mathias
