Mail Archives: djgpp/2004/04/02/17:15:56
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f
|
From: | Fabrizio Gennari <fabrizio DOT ge AT tiscalinet DOT noitspam>
|
User-Agent: | Mozilla/5.0 (Windows; U; Win 9x 4.90; it-IT; rv:1.6) Gecko/20040113
|
X-Accept-Language: | it, en, en-us
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | CMDXSWP.COM missing from list of DOS shells
|
Lines: | 24
|
Message-ID: | <hylbc.11845$rM4.427195@news4.tin.it>
|
Date: | Fri, 02 Apr 2004 22:11:25 GMT
|
NNTP-Posting-Host: | 82.49.166.76
|
X-Complaints-To: | newsmaster AT tin DOT it
|
X-Trace: | news4.tin.it 1080943885 82.49.166.76 (Sat, 03 Apr 2004 00:11:25 MET DST)
|
NNTP-Posting-Date: | Sat, 03 Apr 2004 00:11:25 MET DST
|
Organization: | TIN
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
FreeDOS distributes a shell called CMDXSWP.COM, which is a DOS-style
shell. i.e. requires the /c switch when launching commands.
Unfortunately, it is not present in the list of DOS-style shells present
in the file libc/dos/process/dosexec.c, variable shell_brokets. Since
FreeDOS by default sets the COMSPEC env variable to point to this, it
may cause problems: for example, the system() function invokes the shell
without /c, causing the invocation to fail.
Example: take this somple program
int main(){
system("echo Hello World!");
return 0;
}
, compile it with DJGPP, and run it on a FreeDOS system with FreeDOS
installed, no SHELL variable and the variable COMSPEC pointing to
CMDXSWP.COM . It fails, because system(), detecting that echo is not an
executable file, tries to launch the shell, passing "echo Hello World!"
as the parameter. Unfortunately, it does that without the /c switch.
The fix would be to include CMDXSWP.COM in dosexec.c. A workaround is to
set the SHELL variable to COMMAND.COM, which is correctly detected by
DJGPP as being a DOS-style shell.
- Raw text -