fix for exec builtin when the command is not found

This commit is contained in:
Chet Ramey
2022-08-23 09:58:22 -04:00
parent b9ed20acfd
commit 7547afdf73
11 changed files with 400 additions and 10 deletions
+4
View File
@@ -3918,11 +3918,15 @@ execute_cond_node (cond)
arg1 = nullstr;
if (echo_command_at_execute)
xtrace_print_cond_term (cond->type, invert, cond->op, arg1, (char *)NULL);
#if defined (ARRAY_VARS)
if (varop)
oa = set_expand_once (0, 0); /* no-op for compatibility levels <= 51 */
#endif
result = unary_test (cond->op->word, arg1, varflag) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
#if defined (ARRAY_VARS)
if (varop)
assoc_expand_once = oa;
#endif
if (arg1 != nullstr)
free (arg1);
}