From f469bdc7596ee5d352af41c0aa3dfc52300ad245 Mon Sep 17 00:00:00 2001 From: dmccordjr Date: Mon, 30 Apr 2018 08:49:40 -0400 Subject: [PATCH] handle [issue #3](https://github.com/SLaks/Minimatch/issues/3) - "FolderName\" fails with empty string. This should get swallowed like "." --- Minimatch/Minimatcher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Minimatch/Minimatcher.cs b/Minimatch/Minimatcher.cs index 450a0e9..3807211 100644 --- a/Minimatch/Minimatcher.cs +++ b/Minimatch/Minimatcher.cs @@ -960,7 +960,7 @@ bool MatchOne(IList file, IList pattern, bool partial) // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. if (swallowee == "." || swallowee == ".." || - (!options.Dot && swallowee[0] == '.')) + (!options.Dot && !string.IsNullOrEmpty(swallowee) && swallowee[0] == '.')) { //if (options.debug) // console.error("dot detected!", file, fr, pattern, pr)