delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/13/13:00:07

From: "Arthur J. O'Dwyer" <ajo AT andrew DOT cmu DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in command-line globbing
Date: Fri, 13 Dec 2002 12:48:59 -0500 (EST)
Organization: Carnegie Mellon, Pittsburgh, PA
Lines: 31
Message-ID: <Pine.GSO.4.44L-027.0212131242480.6504-100000@unix2.andrew.cmu.edu>
NNTP-Posting-Host: smtp7.andrew.cmu.edu
Mime-Version: 1.0
X-Trace: bb3.andrew.cmu.edu 1039801740 16644 128.2.10.87 (13 Dec 2002 17:49:00 GMT)
X-Complaints-To: advisor AT andrew DOT cmu DOT edu
NNTP-Posting-Date: 13 Dec 2002 17:49:00 GMT
In-Reply-To: <Pine.GSO.4.44L-027.0212131136220.4357-100000@unix4.andrew.cmu.edu>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Fri, 13 Dec 2002, Arthur J. O'Dwyer wrote:
>
> If I wanted to write my own globbing code, could I put it in
> __crt0_glob_function() something like this?
>
[snipped long useless function]

Apparently not.  I used

char **__crt0_glob_function(char *arg) {
  printf(":%s:\n", arg);
  return 0;
}

to see what was getting passed to the function, and it turns out that
this "workaround" is possibly *more* useless than the default behavior.

 * Arguments are split at whitespace and stripped of quotes before
   being passed to the function.  Can you write "echo" in DJGPP?

 * Quote-globbing still occurs.  \ escapes quotes and nothing else.
   So my problem can't be fixed this way anyway.

 * Arguments do not get passed to __crt0_glob_function if they contain
   a quoted wildcard character.  This renders the function useless for
   performing any sort of non-default wildcard globbing.


-Arthur

- Raw text -


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