Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfRangeException #42

Closed
alphaleonis opened this issue Dec 6, 2017 · 7 comments
Closed

IndexOutOfRangeException #42

alphaleonis opened this issue Dec 6, 2017 · 7 comments

Comments

@alphaleonis
Copy link

alphaleonis commented Dec 6, 2017

The following lines generate an IndexOutOfRangeException:

var glob = Glob.Parse("C:\\Bin\\*.pdb");
glob.Match("C:\\Bin\\.vs");
@dazinator
Copy link
Owner

Thank you, I will add a test and assuming it replicates, I will roll out a fix in short order.

@dazinator
Copy link
Owner

@alphaleonis I was not able to replicate this on latest develop branch. What version of dotnet glob nuget package are you using?

@dazinator
Copy link
Owner

@alphaleonis - As I can't replicate this, I will close this for now, but please re-open if you still have issues and can give me the version you are using!

@alphaleonis
Copy link
Author

I was using the latest version from NuGet, i.e. 1.6.9. With that I can replicate it just by creating a new C# .NET Framework Console app, adding a package reference to DotNet.Glob, and adding the two lines in the bug to the main method. Running the program the causes an IndexOutOfRange exception. Perhaps it has already been fixed in the repo?

@dazinator
Copy link
Owner

Hmm not sure. But I added a test case for the above, and it passed. If you can manage to provide a failing test case, I will re-open and investigate. If not then I am a bit stumped.

@alphaleonis
Copy link
Author

alphaleonis commented Jan 1, 2018

Well, it will be hard to reproduce now since the method appears to have been removed in a77ae3b
;) (Although the comment for the commit says IsMatch was removed, it appears Match is the method that actually was removed, and probably the intention as well)

@dazinator
Copy link
Owner

Ah yes I see the confusion now apologies. Match was removed as per #28 - IsMatch should be used in the majority of cases. My tests were done using IsMatch hence why I couldnt replicate! Match was indeed buggy as you discovered :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants