delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/24/19:49:53

From: James <legend AT bitsmart DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BUG: DJGPP, argc and *
Date: Sat, 21 Jun 1997 13:50:20 +0800
Organization: Kewl
Lines: 23
Message-ID: <33AB6B9C.30353127@bitsmart.com>
References: <199706110609 DOT JAA19858 AT andromeda DOT delta DOT edu DOT gr>
NNTP-Posting-Host: grunge169.nv.iinet.net.au
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Kappas Ioannis wrote:

> I think I've found a bug in DJGPP. When an argument in the command
> line is
> the character * the argc is 108 instead of 2.
>         consider this program:
> main(int argc, char *argv[])
> {
>         printf("%d\n", argc);
>         return 0;
> }
>
> when we call the program with the asterisk, e.g. "a *" the argc is
> returning
> 109 instead of 2. Is this normal or is this a bug??

 Ok DJGPP treats command line arguments like unix/linux when u specify *
it gets all the files in the current directory and puts them as args
instead. When argc reported 109 or whatever this means that there was
108 files in the working directory.... get it???

D.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019