Kern Sibbald wrote:
> Hello,
> 
> You would think that wild cards (fnmatch) are well known and that they work 
> the same on all systems.  Apparently not.
> 
> On GNU clib systems,
> 
>   fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME|FNM_PERIOD) returns fail 
>     (i.e. FN_NOMATCH).
> 
> and on my version of the BSD fnmatch.c it returns success.  I could have 
> messed up the code in porting it into Bacula, but I consider that *highly* 
> unlikely.

Well, Solaris 10 behaves the following way:

  fnmatch("a*b/*",  "abbb/.x", FNM_PATHNAME|FNM_PERIOD) -> FNM_NOMATCH
  fnmatch("a*b/.*", "abbb/.x", FNM_PATHNAME|FNM_PERIOD) -> MATCH

as opposed to FreeBSD 5.4 which returns a match in both cases.

I think the Solaris/GNU way is the correct way, since with
FNM_PATHNAME|FNM_PERIOD "/." should only match an explicit "/."
in pattern.

Attila


> In reading the GNU documentation on fnmatch, it is not clear which is 
> correct -- in fact, depending on nuances of precedences of the rules, which 
> is not documented, both interpretations seem to be correct.
> 
> Does anyone have any opinions?  Am I missing something?
> 
> I must admit: this is somewhat a tricky case. :-)
> 
> Regards,
> 
> Kern
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Bacula-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/bacula-devel
> 
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to