[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Behavior of glob/fnmatch with square brackets
From: |
Andreas Schwab |
Subject: |
Re: Behavior of glob/fnmatch with square brackets |
Date: |
Tue, 05 Aug 2003 22:09:54 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) |
"David W. Bettis" <address@hidden> writes:
|> Greetings,
|>
|> Consider the following snippet of code:
|>
|>
|> int result_code;
|>
|> /* check to see if [foo]/bar matches the pattern [foo]/* */
|> if((result_code = fnmatch("\\[foo\\]/*", "\\[foo\\]/bar", 0)) == 0)
Code and comment disagree, so probably both are wrong.
"\\[" can't match "\\", so the rest is not even considered.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."