fa8d9dbb
by Lokesh Poovaragan at 2026-07-28T00:14:09+02:00
cmd: Handle caret escape in delayed expansion.
Add caret (^) to the scan loop in handleExpansion as a peer of % and !.
When ^ immediately precedes ! during delayed expansion, the caret is
removed and the exclamation mark is treated as literal — matching
Windows' inline caret processing during variable expansion.
The caret scan is restricted to ^! only; other caret sequences such as
^% in pipe payloads are left untouched for subprocesses to handle.
Additional test cases for ^! interaction outside quotes are included;
these currently produce identical output on Wine and Windows, and will
be updated when caret handling is moved out of the lexer entirely in a
separate patch.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54928
Signed-off-by: Lokesh Poovaragan <lokesh.poovaragan@gmail.com>