Subject: Re: argc/argv
From: [email-masked] (Christopher G. Faylor)

16 Jan 1999 04:13:02 GMT
Message-ID: <[email-masked]>
References: <[email-masked]> <[email-masked]>
X-Newsreader: trn 4.0-test63 (15 March 1998)

In article <[email-masked]>,
Warren Young <[email-masked]> 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.
-- 
[email-masked]
http://www.cygnus.com/