check some TODOs

- "is t_call.argv ended by NULL?"
- "does it return the good path if there is several possibilities?"
This commit is contained in:
mcolonna 2024-04-29 15:56:49 +02:00
parent 117631d50e
commit 8d5ccfeb82
3 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
/* Updated: 2024/04/29 15:48:25 by mcolonna ### ########.fr */
/* Updated: 2024/04/29 15:56:26 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -77,8 +77,10 @@ void fatal_error(const char *msg);
// Return a list of strings ended by NULL.
char **get_path(char *const envp[]);
// Search the program in PATH.
// Search the program in $PATH.
// Returns the path of the program to use, or NULL if there is none.
// If there is several possibilities, it returns the one from the first path
// given in $PATH.
const char *search_path(
const t_memclass mc, const char **path, const char *prog);

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 13:48:00 by jschaft #+# #+# */
/* Updated: 2024/04/26 14:21:15 by mcolonna ### ########.fr */
/* Updated: 2024/04/29 15:51:00 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,7 +26,6 @@ static void free_tab(char **tab)
free(tab);
}
// TODO is t_call.argv ended by NULL?
static void fork_exec(const char *path, t_call call, const int inout[2],
char *const envp[])
{

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/16 12:07:26 by jschaft #+# #+# */
/* Updated: 2024/04/26 12:24:41 by mcolonna ### ########.fr */
/* Updated: 2024/04/29 15:54:40 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -27,7 +27,6 @@ char **get_path(char *const envp[])
return (re);
}
// TODO does it return the good path if there is several possibilities?
const char *search_path(
const t_memclass mc, const char **path, const char *prog)
{