Skip to content

Commit

Permalink
Fix non-pattern match iterator.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisant996 committed Dec 15, 2020
1 parent b0db2a5 commit 96c4ad6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions clink/lib/src/matches_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,20 @@ bool matches_iter::next()
while (match_len && path::is_separator((unsigned char)match[match_len - 1]))
match_len--;
if (path::match_wild(m_pattern, str_iter(match, match_len)))
{
if (is_pathish(get_match_type()))
m_any_pathish = true;
else
m_all_pathish = false;
return true;
}
goto found;
}
}

m_index = m_next;
if (m_index >= m_matches.get_match_count())
return false;
m_next++;
assert(!m_has_pattern); // Must not exit through here (m_any_pathish, etc).

found:
if (is_pathish(get_match_type()))
m_any_pathish = true;
else
m_all_pathish = false;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion clink/lib/src/rl/rl_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static char** alternative_matches(const char* text, int start, int end)
#ifdef DEBUG
if (debug_matches)
{
printf("count = %d\n", count - 1);
printf("count = %d\n", count);
printf("filename completion desired = %d (%s)\n", rl_filename_completion_desired, iter.is_filename_completion_desired().is_explicit() ? "explicit" : "implicit");
printf("filename display desired = %d (%s)\n", rl_filename_display_desired, iter.is_filename_display_desired().is_explicit() ? "explicit" : "implicit");
printf("is suppress append = %d\n", s_matches->is_suppress_append());
Expand Down

0 comments on commit 96c4ad6

Please sign in to comment.