delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/11/29/11:16:16

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Message-ID: <456dad03$0$486$cc7c7865@news.luth.se>
From: Martin Str|mberg <ams AT speedy DOT ludd DOT ltu DOT se>
Subject: Re: fnmatch("\\\\", "\\", 0) == 1 ???
Newsgroups: comp.os.msdos.djgpp
References: <iKydndAovO98z_DYnZ2dnUVZ_sadnZ2d AT comcast DOT com> <LO6dnbePOLnKzvDYnZ2dnUVZ_sGdnZ2d AT comcast DOT com>
User-Agent: tin/1.4.6-20020816 ("Aerials") (UNIX) (NetBSD/1.6Q (alpha))
Date: 29 Nov 2006 15:53:40 GMT
Lines: 30
NNTP-Posting-Host: speedy.ludd.ltu.se
X-Trace: 1164815620 news.luth.se 486 130.240.16.13
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Alexei A. Frounze <alexfru AT chat DOT ru> wrote:
> Alexei A. Frounze wrote:
>> FYI fnmatch("\\\\", "\", 0) in DJGPP returns 1(no match)  -- the

> obvious correction (missed one slash):
> fnmatch("\\\\", "\\", 0)

>> escaping functionality seems to be broken.
>> The same function call returns 0 (match) in Linux (Red Hat 9 kernel
>> 2.4.20) -- what it should be.

Info page says
"     #include <fnmatch.h>
     
     int fnmatch(const char *pattern, const char *string, int flags);

Description
-----------

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.


Right,

						MartinS

- Raw text -


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