void dispatch(t_env **env, char **c) { char *path; char **tabenv; tabenv = NULL; if (!c[0]) return ; tabenv = settabenv(env); if (b_check(c, env) == 1) return (ft_freetab(tabenv)); else if ((path = iscommande(env, c[0])) != NULL) { into_fork(path, c, tabenv); free(path); } else if (c[0] && ((islocalexec(c[0]) == 1) || \ (isexec(c[0], env) == 1))) { g_flagsignal = -1; into_fork(c[0], c, tabenv); } else if (c[0]) notfound_error(c[0]); ft_freetab(tabenv); }
inline bool isexec(const string& fname) { return isexec(fname.c_str()); }