X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.232.190 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: fnmatch("\\\\", "\\", 0) == 1 ??? Organization: Systematic Software Message-ID: References: <456dad03$0$486$cc7c7865 AT news DOT luth DOT se> <200611291634 DOT kATGYcbw010800 AT envy DOT delorie DOT com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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" 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