Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux