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

14 Jan 1999 14:24:50 GMT
Message-ID: <[email-masked]>
References: <[email-masked]>
X-Newsreader: trn 4.0-test63 (15 March 1998)

In article <[email-masked]>,
 <[email-masked]> wrote:
>Hi! Evidently gcc treats argc/argv quite differently from
>Turbo C when * appears in any argvs. It always tries to
>replace this argv with as many as possible matching files.
>For example,
>
>main(int argc, char *argv[])
>{ int i;
>  for (i=1; i<argc; i++) printf("argv[%d]=%s\n", i, argv[i]);
>}
>
>Run it with t*.c as the command argument,
>
>Compiled with GCC, it prints:
>argv[1]=Test.c
>argv[2]=Text2html.c
>argv[3]=Timezone.c
>
>Compiled with Turbo C, it prints:
>argv[1]=t*.c
>
>i know nothing about any standard or coding conventions
>about this, but could any of you tell me which is more
>standard or conventional?

For UNIX it is conventional to expand arguments on the
command line.  For MS-DOS/Windows this is optional (at least
with MSVC) depending on whether you've linked your program
with a special object file: setargv.obj .

If you don't want your console command line expanded try

	set CYGWIN=noglob

Note that this will not affect this behavior if you're running
under bash or some other shell.  Since those are UNIX utilities
they will always expand * unless you quote it.
-- 
[email-masked]
http://www.cygnus.com/