This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problems with mingw32 GCC 2.8.0 !!!


Fabio Vignoli wrote:
> Just to joke:
> try in a MSDOS shell on windows NT : cd Program Files (it works)
>                                      cd "Program Files" (it works)
>                                      dir Program Files (DOES NOT WORK!!!)
>                                      dir "Program Files" (it works)
> Does anybody can tell me why?

;-)

If I had to guess I'd say it's just programmer's laziness and probably
backwards compatibility afterwards. You have to remember that in
DOS/Windows the command line is not parsed by the shell but by the
programs themselfs. That makes for a lot of inconsistencies between
applications and commands and seemingly even between command.com
built-ins.

The story probably was: The cd command has no options (or at least it
didn't use to), so the programmer of command.com did not bother to parse
the command line, he just took it and used it as a whole. In later
versions he added code to strip the quotes for compatibility with other
commands but he didn't use the full command-line parser, because that
might not have been backwards compatible with the use of the cd command
in older batch scripts. The dir command OTOH has a lot of options, so
the command line *has* to be parsed and after parsing Program Files
becomes two arguments.

All just guesswork, of course ;-)
======================================
Benjamin Riefenstahl (benny@crocodial.de)
Crocodial Communications EntwicklungsGmbH
Ophagen 16a, D-20257 Hamburg, Germany
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]