Mail Archives: djgpp/2000/04/20/13:52:50
> Date: Thu, 20 Apr 2000 14:00:20 +0200
> From: Erik Sandberg <erik DOT sandberg AT euroseek DOT net>
>
> I'm using win98's DOS shell and grep 2.4, and if I do e.g.
> grep \". *.ini |more
> in the c:\windows directory (or a search in a different file set, if there
> just are some matches), I get strange output:
>
> C:\WINDOWS>grep \". *.ini |more
> netdet.ini:HKLM,System\CurrentControlSet\Services\VxD\NWLINK,cachesize,,"16"
> netdet.ini:HKLM,System\CurrentControlSet\Services\VxD\NWLINK\Ndi\params\cach
> esiz
> e,"",,"16"
> netdet.ini:%26%\protocol.ini,NWLINK$,,"cachesize=16"
> win.ini:rhide.exe="D:\DJGPP\BIN\rhide.exe"
> grep: |more: No such file or directory (ENOENT)
> grep: EMP=C:\TEMP: No such file or directory (ENOENT)
>
> In a more complex situation, there were trash characters instead of
> "EMP=C:\TEMP".
I can confirm this problem on Windows 98.
> It looks like a bug in DOS (the same thing occur to BCC's grep), somehow
> DOS seems to report the wrong argc/argv if there's a \" in the parameter
> list. In any case it would be cool if DJGPP could add a workaround for it.
I don't think this has anything to do with DJGPP. I can actually
crash a DOS box ("This program performed an illegal instruction...")
on Windows 98 by typing this:
echo \" | more
Since ECHO is an internal command in COMMAND.COM, this looks like a
bug in COMMAND.COM. Depending on the context, it either crashes or
passes some wild command-line tail to the programs it invokes. As far
as I could see, the crashes happen even before the DJGPP program
starts running its startup code.
I don't see any way to fix this in DJGPP. The crashes obviously
happen before our code runs, and as for corrupted command lines, what
can we do except trust the shell to pass us correct command lines?
You can use Bash to avoid these problems.
- Raw text -