This is the third serie related to rewriting cmd's command engine.
Currently, cmd stores block of commands as a linked list of CMD_LIST.
Even for nested commands (like 'if' command inside a 'for' command), it's
parsed as a single list of commands, using a 'depth' attribute and marker
for end of block to describe the structure.
This leads to several issues:
- parsing for nested commands is not 100% robust,
- chaining of commands (and its precedence) is not handled,
- no separation between parsing and execution (esp. for 'IF' and 'FOR'
commands, which behave slightly differently than regular commands
when dealing with variables with delayed expansion),
- data model doesn't 100% fit native behavior (eg redirections can
apply to a block of commands, whereas redirections are attached
to individual commands)
- ...
The final goal is to replace this with:
- a tree of commands:
+ binary nodes for command chaining,
+ 'IF' and 'FOR' commands being parsed and stored as such
+ leaf being a command
It will require a couple more series to reach that goal, so
this series puts in place the basic building bits:
- introducing a new structure CMD_NODE to hold that each node
of such a tree,
- moving the chaining operator into that CMD_NODE (meaning
that we move from a linked list to a binary tree degenerated
into a list: left is command, right is next node).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5609
strmbase is built against msvcrt (and needs to remain as such to be used in tests). Hence modules that link to it also need to be built against msvcrt.
In practice, this happens to work, but it causes some subtle strangeness. In particular, since ucrtbase does not export the simple printf functions, we end up instead linking to ntdll, whose implementation is notably incomplete, missing any float specifiers. While it's possible that ntdll should add those, we shouldn't be linking against ntdll's CRT anyway.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5607