delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/21/05:25:15

Newsgroups: comp.os.msdos.djgpp
From: manfred DOT heumann AT uni-bielefeld DOT de (Manni Heumann)
Subject: Re: How do I pass * (astrix) over argv ?
References: <7s6rjn$gq7$1 AT nnrp1 DOT deja DOT com>
X-Newsreader: News Xpress 2.01
Date: Tue, 21 Sep 1999 07:52:41 GMT
NNTP-Posting-Host: dhcp33-114.uni-bielefeld.de
Message-ID: <37e73955.0@news.uni-bielefeld.de>
X-Trace: 21 Sep 1999 09:52:53 +0200, dhcp33-114.uni-bielefeld.de
Lines: 39
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <7s6rjn$gq7$1 AT nnrp1 DOT deja DOT com>, hank_heng AT hotmail DOT com wrote:
>Hello,
>
>  I'm using DJGPP, and I notice that if I do something like this :
>
>  myprog *.*
>
>  *.* actually copy all available file name that found in that
>directory and store it in argv[1], argv[2], argv[3] ... and so on...
>
>  I don't want this to happen, so how do I pass '*.*' over the command
>line and receive '*.*' in argv[1] instead of bunches of file names.
>
>  Thanks For Reading This And Please Help Me Out.  :)
>
>
>
>-Hank

See the FAQ (sections 16.1 and 16.2).

Summary: The function that expands the commandline is called 
__crt0_glob_function() and is automagically linked in your program. If you 
don't like this, you can simply provide your own version of that function that 
does nothing:

#include <crt0.h>
char **__crt0_glob_function(char *)
{
    return 0;
}

rest of your program.



--

Manni

- Raw text -


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