dazinator / DotNet.Glob

A fast globbing library for .NET / .NETStandard applications. Outperforms Regex.
MIT License
363 stars 27 forks source link

IndexOutOfRangeException with ** #67

Closed bmode closed 4 years ago

bmode commented 5 years ago

Using DotNet.Glob 3.0.5

Glob.Parse("foo**").IsMatch("foo")

throws

IndexOutOfRangeException: Index was outside the bounds of the array.

at DotNet.Globbing.Evaluation.WildcardDirectoryTokenEvaluator.IsMatch(String allChars, Int32 currentPosition, Int32& newPosition)   at DotNet.Globbing.Evaluation.CompositeTokenEvaluator.IsMatch(String allChars, Int32 currentPosition, Int32& newPosition)   at DotNet.Globbing.Glob.IsMatch(String subject)   at

olivier-spinelli commented 5 years ago

This is fixed in https://github.com/dazinator/DotNet.Glob/pull/66 that is waiting to be merged.

This PR includes tests, is there any reason to not merge it?

dazinator commented 5 years ago

@olivier-spinelli sorry for some reason I stopped getting github notifications and missed this activity. I'll look into this and if all in order I'll get it merged this week. Thanks for opening an issue and submitting a PR.

dazinator commented 5 years ago

I've merged the PR into develop - which fixes this issue on the latest develop release which is 3.1.0 alpha 9. Thank you very much @olivier-spinelli for the Pr (and the valuable extra test case!)

For those that don't like using "prerelease" nuget packages, I'll create a version 3.0.6 containing this fix on the stable nuget channel sometime this week.

olivier-spinelli commented 5 years ago

Thanks! But please note that this PR has been created by @antoine-r (a friend of mine to whom I talked about this issue): he is the one to thank for this good job!

dazinator commented 5 years ago

Haha @olivier-spinelli @antoine-r apologies for the mix up.It's been a long day for me already and it's only 9.10am :-)

Thank you @antoine-r !

atifield commented 5 years ago

@dazinator Any update on stable version 3.0.6 with this fix? I still see 3.0.5 as latest stable. Thanks!

dazinator commented 5 years ago

Sorry, I should get to this within the next week. Alternatively use the latest pre release nuget package with the fix if that's an option for you!

sualitu commented 4 years ago

Any news on getting this to stable? :)

dazinator commented 4 years ago

Released as 3.0.8 to hit nuget shortly.