action: do not expand env vars in Exec action

...<command> argument (but still resolve tilde).

This makes it easier to write sh -c '' constructs without turning labwc
into a shell parser in order to expand environment variables, whilst
respecting single quotes and escaped characters as well as ignoring
subshells syntax like $(foo) and backticks.

Also, fix bug where buffer length+alloc get out-of-sync
This commit is contained in:
Johan Malm 2023-09-21 23:09:05 +01:00 committed by Johan Malm
parent c6c1f8e04b
commit 881d788bee
6 changed files with 44 additions and 12 deletions

View file

@ -38,6 +38,7 @@ process_line(char *line)
buf_init(&value);
buf_add(&value, string_strip(++p));
buf_expand_shell_variables(&value);
buf_expand_tilde(&value);
if (string_empty(key) || !value.len) {
goto error;
}