A18: Fix shell command substitution syntax
- expand_vars was adding '(' at the start but missing ')' at the end
- Added closing parenthesis to properly wrap subshell command
- Changed cmd[1 + cmdlen] = '\0' to cmd[1 + cmdlen] = ')' and cmd[2 + cmdlen] = '\0'
Tests: 119/119 PASS (smoke test, SMP=4)
char cmd[258];
cmd[0] = '('; /* wrap in subshell */
memcpy(cmd + 1, start, (size_t)cmdlen);
- cmd[1 + cmdlen] = '\0';
+ cmd[1 + cmdlen] = ')'; /* A18: add closing parenthesis */
+ cmd[2 + cmdlen] = '\0';
int pfd[2];
if (pipe(pfd) == 0) {
int pid = fork();