Skip to content

core: glob matcher (TASKS 1.7) - #24

Merged
hightemp merged 3 commits into
mainfrom
core/glob
Oct 23, 2026
Merged

hightemp merged 3 commits into
mainfrom
core/glob

Conversation

@hightemp

Copy link
Copy Markdown
Owner

TASKS 1.7 (FR-5.4). Design note: PRD section 13, "1.7".

  • src/core/ig_glob.{h,c}: ig_glob_match(pat, plen, s, slen, flags) matches the whole string.
    • * matches any sequence, including across /; \ escapes the next character; ?, [ and the rest are literal.
    • Case-sensitive by default; IG_GLOB_NOCASE folds ASCII only (header names).
    • Iterative, backtracking to the last *: O(plen·slen), constant stack, so a configured pattern cannot blow up. Binary-safe.
    • The prefix semantics of exclude_paths stay in the config layer (2.x).
  • Added to IG_SOURCES in config.m4.
  • Tests: tests/unit/test_glob.c (9 cases, including 20 stars against 20 KB), fuzz target fuzz_glob checked against a naive recursive reference.

Local: unit (gcc, clang ASan/UBSan, CentOS 7), clang-tidy, clang-format, cppcheck, phpt on 7.0 NTS and 8.5 ZTS, fuzz_glob 60 s (1.46M runs), license check.

🤖 Generated with Claude Code

hightemp and others added 3 commits October 23, 2026 12:05
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ig_glob_match(): '*' (across '/'), '\' escaping, everything else literal,
optional ASCII case folding. Whole-string match, binary-safe, iterative
backtracking to the last star: O(plen * slen), constant stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hightemp
hightemp merged commit a40ab70 into main Oct 23, 2026
90 checks passed
@hightemp
hightemp deleted the core/glob branch October 23, 2026 09:18
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

Successfully merging this pull request may close these issues.

1 participant