argc/argv

Christopher G. Faylor cgf@cygnus.com
Sun Jan 31 23:52:00 GMT 1999


In article <4.1.19990114113241.00a7d040.cygnus.gnu-win32@mail.cyberport.com>,
Warren Young <tangent@cyberport.com> wrote:
>At 05:24 PM 1/14/99 +0800, you wrote:
>Actually, it's not gcc setting up argv that way, but the C startup code
>that ships with Cygwin's C library (libc).  This libc is trying to be
>Unix-like in the absence of a Unix shell.  On a true Unix-like operating
>system, the shell (sh, csh, bash, etc.) expands wildcards before running
>the program.  But since you can't count on this under Win32, libc
>apparently takes over this task.
>
>It's curious, though, that when you run your test program under Cygwin's
>bash like this:
>
>	$ test "t*"

Actually, it's not really curious.  It's cygwin working as designed.
It wouldn't make sense to expand something like this inside a shell
so it doesn't happen.

>the t* isn't expanded.  This is normally the Right Thing, since double
>quotes tells the shell not to expand wildcards, but the wildcarded argument
>should be expanded by libc as it is when you run it from cmd.exe.  I
>suspect that bash passes the quotes to the program literally, so that the C
>startup routines will see them and not to expand the wildcard.

No.  bash has not been modified in this way for cygwin.  The DLL essentially
detects when it is being run from the "DOS" command shell and does the
appropriate thing.
-- 
cgf@cygnus.com
http://www.cygnus.com/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list