Skip to content

Fix Winuxsh framework glob loading and hook dispatch - #17

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/winuxsh-framework-integration
Aug 2, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/winuxsh-framework-integration

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

  • expand unquoted glob suffixes after quoted parameter prefixes in command and loop word expansion
  • expose direct Executor function lookup and dispatch APIs for embedded hosts
  • support the sed forms needed by aliasconv-style upstream Bash examples

Testing

  • cargo check --tests
  • cargo test
  • BASH_UPSTREAM_STRICT=1 scripts/run-bash-upstream-tests.sh (87/87 passed)

Closes #15
Closes #16

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.
@caomengxuan666
caomengxuan666 merged commit 6887ef1 into master Aug 2, 2026
3 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/winuxsh-framework-integration branch August 2, 2026 17:32
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]>
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.

Expose function lookup/dispatch API for embedded hosts Glob after quoted parameter prefix is not expanded in for list

1 participant