int exec_cmd(t_parser *parser, t_env *envs) { t_command *cmd; close_pipes(parser->father); cmd = parser->command; if (check_for_exec(cmd->new_argv, envs->env) == -1 || (envs->path && check_path_exec(cmd->new_argv, envs->env, envs->path) == -1)) return (-1); return (0); }
/* <obj> exec - */ int zexec(i_ctx_t *i_ctx_p) { os_ptr op = osp; int code; check_op(1); code = check_for_exec(op); if (code < 0) { return code; } if (!r_has_attr(op, a_executable)) { return 0; /* shortcut, literal object just gets pushed back */ } check_estack(1); ++esp; ref_assign(esp, op); esfile_check_cache(); pop(1); return o_push_estack; }