22#include "../utils/utils.h"
41 return (
err(
"malloc() failed while assembling path to cmd", 0));
42 if (!access(cmd, F_OK))
51 return (
err(
"malloc() failed while assembling path to cmd", 0));
52 if (!access(cmd, F_OK))
void * err(const char *str, void *retval)
Wrapper around perror() that always returns retval.
char * ft_strdup(const char *s1)
Allocates memory for, copies to, and returns a duplicate of s1.
char * ft_strjoin(char const *s1, char const *s2)
Allocates enough space for and appends string s2 to string s1 and returns the new string.
char * get_cmd(char **paths, char *name)
Find and return the first existing file with called name from the array of paths.