Date: Fri, 24 Nov 1995 08:06:12 -0200 From: Cesar Scarpini Rabak Sender: Cesar Scarpini Rabak Reply-To: Cesar Scarpini Rabak Subject: Re: A DOS bug that may cause trouble for djgpp users To: "A.Appleyard" Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu On Thu, 23 Nov 1995, A.Appleyard wrote: > As hereinunder, Messy-DOS's *.BATfile caller goes BATs when it finds an `=' in > an argument. This may cause obscure trouble for people who call a Gnu C/C++ > program via a *.BAT . I have MS-DOS 6.22 . <-------- marks lines that I typed. > > C:\AMZIP>TYPE T$.CC <------------ > #include > main(int nargs,char**Arg){int i; > for(i=0;i C:\AMZIP>TYPE T$$.BAT <------------- > t$.exe %1 %2 %3 %4 %5 %6 %7 %8 > C:\AMZIP>t$ cat=and=mouse=games <---------------- > 0th arg is `c:/amzip/t$.exe' > 1th arg is `cat=and=mouse=games' > > C:\AMZIP>t$$ cat=and=mouse=games <------------------ > > C:\AMZIP>t$.exe cat and mouse games > 0th arg is `c:/amzip/t$.exe' > 1th arg is `cat' > 2th arg is `and' > 3th arg is `mouse' > 4th arg is `games' > This idiosincrasy of MS-DOG is more or less known, (though I cannot remember where is it explained in fully to give you folks a pointer), however, if you need to put one of the line arguments like the example above, just enclose the whole argument with quotation marks like: t$$ "cat=and=mouse=games". This should do the trick. Incidentally, the root of this behaviour is credited to COMMAN.COM, probably users of other (replacement) shells for MS-DOG shoud not have this sort of problem (except if it emulates exactly this behaviour, of course!).