delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/01/15:45:17

From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Command line wildcard expansion under Win2K
Date: Sat, 01 Feb 2003 14:05:52 CST
Organization: Rice University, Houston TX
Lines: 26
Message-ID: <3e3c28a0.sandmann@clio.rice.edu>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1030130095126 DOT 2797A-100000 AT is> <3e394a9a DOT sandmann AT clio DOT rice DOT edu> <b1c3go$5d2$1 AT sass2141 DOT sandia DOT gov> <3e39ff1a DOT sandmann AT clio DOT rice DOT edu> <7458-Sat01Feb2003124759+0200-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: clio.rice.edu
X-Trace: joe.rice.edu 1044130924 23031 128.42.105.3 (1 Feb 2003 20:22:04 GMT)
X-Complaints-To: abuse AT rice DOT edu
NNTP-Posting-Date: 1 Feb 2003 20:22:04 GMT
X-NewsEditor: ED-1.5.9
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> > Look at the variable "caseless" (in particular where it is set when the
> > name has upper case characters and use_lfn).
> 
> I wish it were that simple, but it isn't.  

Actually, it is.  This variable is only used to control the flags to
the fnmatch call (the FNM_NOCASE flag).  If "caseless" is set to 1, 
the glob always does a case insensitive match, which is what the OP 
wants (and is standard for all DOS/Win program behavior on the file
system).

Adding a statement like "if crt_flag_alwayscaseinsensitiveglob caseless=1"
should work (or make this default and require a flag to enable upper
case quirkyness).

> The ``when-to-downcase'' issue pops up in other places, not just in `glob'.  

The what to return/display issue doesn't have anything to do with matching
case insensitively - the return file name will work in open statements
no matter what the case is.  No proposal to change that behavior at all.
There is a flag to control it.  There is no flag to control the 
non-standard globing behavior.

If there are specific instances of GNU/Unixy programs that would expect
glob to fail (not match) based on case - I would argue they should be
the exceptions instead of the rule on a DOS/Windows based compiler.

- Raw text -


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