Skip to content

Commit d8c59a8

Browse files
authored
Merge pull request #102 from ellert/partial-undefined
Always assign `partial` when returning `true`
2 parents ae859f7 + fdf6633 commit d8c59a8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Filter.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ bool FilterFileSystem::GlobOne(const std::filesystem::path &path,
434434
// If the globstar is at the end of the glob, then we match
435435
// any subsequent part of the path.
436436
if (++cur_glob_component == glob.m_glob.end()) {
437+
partial = false;
437438
return true;
438439
} else {
439440
// To evaluate the globstar, we compare the remainder of the
@@ -489,6 +490,7 @@ bool FilterFileSystem::GlobOne(const std::filesystem::path &path,
489490
if (GlobOne(subpath, {glob.m_match_dotfile, new_glob},
490491
subpartial)) {
491492
if (!subpartial && !path_prefix_has_dotfile) {
493+
partial = false;
492494
return true;
493495
} else if (path_prefix_has_dotfile) {
494496
potential_match = false;

0 commit comments

Comments
 (0)