X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Wed, 29 Nov 2006 11:34:38 -0500 Message-Id: <200611291634.kATGYcbw010800@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: <456dad03$0$486$cc7c7865@news.luth.se> (message from Martin Str|mberg on 29 Nov 2006 15:53:40 GMT) Subject: Re: fnmatch("\\\\", "\\", 0) == 1 ??? References: <456dad03$0$486$cc7c7865 AT news DOT luth DOT se> Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > This function indicates if STRING matches the PATTERN. ..." > > So DJGPP says that "\" doesn't match "\\" while Linux says it does. > > Well, I say DJGPP is right as the pattern says there should be two > backslashes and you only provide one. Except that PATTERN is a regex influenced by FNM_NOESCAPE and FNM_PATHNAME, and STRING isn't. So a pattern of "\\" is a single escaped backslash, whereas a string of "\" is a single backslash. They should match.