Duy Nguyen <pclouds@xxxxxxxxx> writes: >> Nice analyzes. >> I have one question here: >> If the user specifies '**' and nothing is found, >> would it be better to die() with a useful message >> instead of silently correcting it ? > > Consider the main use case of wildmatch, .gitignore patterns, dying > would be really bad because it can affect a lot of commands.... If the user gives 'foo*' and nothing is found, we may say "no match" and some codepaths that uses wildmatch API may die. And in such place, when the user gives '**' and nothing is found, we should do the same in the same codepath. In either case, the implementation of wildmatch API is not the place to call a die(), I think. And yes, treating an unanchored "**" as if there is just a "*" followed by another '*" makes good sense. Thanks, both.