Repository navigation
Fix Winuxsh framework glob loading and hook dispatch - #17
Merged
Merged
Conversation
Support unquoted glob suffixes after quoted prefixes and expose direct function lookup/dispatch APIs for embedded hosts. Also cover aliasconv sed usage needed by the upstream Bash examples.
This was referenced Oct 16, 2026
caomengxuan666
added a commit
that referenced
this pull request
Oct 16, 2026
expand_case_pattern ran the full word-expansion pipeline plus ~5
String layers per clause per exec even for static literals. GNU
re-expands dynamic patterns per arm (execute_cmd.c:3686/3712
expand_word_leave_quoted, match via match.c/cond.c) but a static
literal trivially expands to itself.
Whitelist classifier (default-deny on both text and raw_text; rejects
$, backquote, quotes, backslash, ~ { < > and all carrier/control
chars; probed GNU tilde-in-pattern HIT) returns Cow::Borrowed with no
alloc; anything else takes the byte-identical slow path. nocasematch
was already hoisted; matcher selection stays syntax-based.
Measured (release, rotated min-of-3, 20k iters): per-arm slope
~2.5us -> ~1us (n=16 literal -39%). Guards: casearm 29/30 (only
pre-existing #17), ifcase 55/55, lib 588/588.
Co-authored-by: caomengxuan666 <[email protected]>
caomengxuan666
added a commit
that referenced
this pull request
Oct 16, 2026
Per-execute_command if/case dispatch: alias-scan ran expand_aliases (Vec clone + per-word probes) per body command; every :/true condition paid inside_compound_condition save/restore + errexit-suppression wrap. Empty alias table (or alias-streamed words): raw first word IS the expanded first word, checked directly. Bare :/true with all channels empty runs unmarked; shadowed words (function/alias) fall through to keep slow-path errexit suppression (review-caught: true() returning nonzero under set -e). 50-cmd else body -26%; guards 55/55 + 29/30 (pre-existing #17 only); 4 shadow regression tests. GNU: execute_cmd.c:3862 execute_if_command, :5200 pointer walk. Co-authored-by: caomengxuan666 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
Closes #15
Closes #16