If a mask has leading wildcard characters followed by an escaped wildcard, for example *\*, one would expect this mask to match against foo*, which it doesn't. In fact it does match against any string containing a backslash character, which assumedly can't be intended behavior, as the backslash is only used as an escaping character in this case.
The same applies to the ? wildcard. For a mask of ???\?, it would be expected to have a match against foo?, which again isn't the case, but there's a match against foo\?.
If this is not intended behavior, and is going to be corrected, the backslash character should be allowed to be escaped by itself, to allow masks like *\\*to be matched against any string containing a \.
Apparently things work like expected with the * wildcard character before changes have been made in aaa00fb6. The example with ? doesn't work there, too.
If a mask has leading wildcard characters followed by an escaped wildcard, for example
*\*
, one would expect this mask to match againstfoo*
, which it doesn't. In fact it does match against any string containing a backslash character, which assumedly can't be intended behavior, as the backslash is only used as an escaping character in this case.The same applies to the
?
wildcard. For a mask of???\?
, it would be expected to have a match againstfoo?
, which again isn't the case, but there's a match againstfoo\?
.If this is not intended behavior, and is going to be corrected, the backslash character should be allowed to be escaped by itself, to allow masks like
*\\*
to be matched against any string containing a\
.