tgrekov-pipex
HIVE pipex May 2024
Loading...
Searching...
No Matches
get_cmd.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_cmd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/22 13:47:02 by tgrekov #+# #+# */
/* Updated: 2024/05/20 12:27:30 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file get_cmd.c.

#include <unistd.h>
#include <stdlib.h>
#include "../utils/utils.h"
#include <libft.h>
Include dependency graph for get_cmd.c:

Go to the source code of this file.

Functions

char * get_cmd (char **paths, char *name)
 Find and return the first existing file with called name from the array of paths.
 

Function Documentation

◆ get_cmd()

char * get_cmd ( char **  paths,
char *  name 
)

Find and return the first existing file with called name from the array of paths.

Parameters
pathsNull-terminated array of paths with trailing forward slashes
nameName of command to search for
Return values
char*Full path to the command

Definition at line 33 of file get_cmd.c.

References err(), ft_strdup(), and ft_strjoin().

Here is the call graph for this function: