delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/12/01/06:30:17.1

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.232.190
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: fnmatch("\\\\", "\\", 0) == 1 ???
Organization: Systematic Software
Message-ID: <ts20n2dg7smi3o754rsmp6ht4bcn2nik0k@4ax.com>
References: <iKydndAovO98z_DYnZ2dnUVZ_sadnZ2d AT comcast DOT com> <LO6dnbePOLnKzvDYnZ2dnUVZ_sGdnZ2d AT comcast DOT com> <456dad03$0$486$cc7c7865 AT news DOT luth DOT se> <200611291634 DOT kATGYcbw010800 AT envy DOT delorie DOT com> <n6qsm2l2pk3svjtu7aqu68mmhdmvldprk5 AT 4ax DOT com> <Sb6dnSX2_Plh5_PYnZ2dnUVZ_rSdnZ2d AT comcast DOT com> <IZWdndsG8_TvCfPYnZ2dnUVZ_rGdnZ2d AT comcast DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 39
Date: Fri, 01 Dec 2006 11:23:54 GMT
NNTP-Posting-Host: 64.59.135.176
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7urf1no 1164972234 64.59.135.176 (Fri, 01 Dec 2006 04:23:54 MST)
NNTP-Posting-Date: Fri, 01 Dec 2006 04:23:54 MST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Thu, 30 Nov 2006 00:20:00 -0800 in comp.os.msdos.djgpp, "Alexei A.
Frounze" <alexfru AT chat DOT ru> wrote:

>One more thing to consider, closing bracket as first character in the 
>list/range inside the bracket expression:
>fnmatch("[]]", "]", 0) must return 0, doesn't
>fnmatch("[!]]", "]", 0) must return 1, does (by luck)
>fnmatch("[!]]", "a", 0) must return 0, doesn't

rangematch() for should be a do ... while.

>And one more, which seems to be partially wrong even in that same RH9 linux 
>distro:
>fnmatch("\ab\c","abc",0) must return 0, does in linux, doesn't in DJGPP
>fnmatch("\[abc\]","[abc]",0) must return 0, doesn't in both linux and 
>DJGPP -- the spec doesn't make an exception for the escaped opening bracket, 
>\[ when describes the escaping option. Dunno, maybe it would be wise not to 
>escape the bracket, but other characters should be made escapable w/o a 
>problem.

Fixing escape handling and range handling should fix those. 

>P.S. all the details obtained from fnmatch()'s description in The Single 
>Unix Specification V3 2004 issue 6.
>P.P.S. of course there's a ton of what DJGPP's fnmatch() doesn't support, 
>but the above things are pretty basic and it would be nice to have them 
>handled properly, unless I overlook some major DOS-related issue for which 
>it would be desirable to deviate from the spec.

Notice that escapes aren't handled in ranges; should they be? 
Should escaped control characters be allowed? 
Shouldn't all \ use in paths be conditional on FNM_NOESCAPE? 
I'll need to checkout my SUS. 

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply

- Raw text -


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