+45
−28
+8
−2
Loading
tokenizeShellArgs() returned the operator ">" and the quoted word '>' as
the same string, so extractRedirections() redirected on both: `echo x '>'
dir` (rust's run_rustc Makefile: echo [CARGO] ... '>' $(OUTDIR)build-std2)
created a file "dir" instead of printing, and cargo then failed on the
directory of that name. Same for ">", \>, '>>', '<'.
The tokenizer now marks the operators it splits off itself (a \x01 prefix,
opt-in via tokenizeShellArgs(..., true)), and extractRedirections(...,
true) only takes marked tokens as operators. The pipeline/subshell/brace
group stages and the compound-command trailing redirection use it; the
other tokenizeShellArgs() users are unchanged.
Checked in the RC5 chroot: the quoted forms print, while >, >>, 2>, <,
2>&1, "{ ...; } > f", "( ... ) > f" and $(...) behave as before.
Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>