UndernetIRC / ircu2

Undernet IRC Daemon
Other
52 stars 20 forks source link

Broken match() behavior with certain masks including escaped wildcard characters #12

Closed miwob closed 3 years ago

miwob commented 3 years ago

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 \.

miwob commented 3 years ago

Apparently things work like expected with the * wildcard character before changes have been made in aaa00fb6. The example with ? doesn't work there, too.