use ft_split_safe

This commit is contained in:
whaffman 2025-03-02 22:34:18 +01:00
parent 22c23cdf5a
commit 43f2100c5c
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
/* By: whaffman <whaffman@student.codam.nl> +#+ */ /* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/20 11:32:53 by whaffman #+# #+# */ /* Created: 2025/02/20 11:32:53 by whaffman #+# #+# */
/* Updated: 2025/03/02 22:09:36 by whaffman ######## odam.nl */ /* Updated: 2025/03/02 22:22:19 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -21,7 +21,7 @@ int builtin_export(t_minishell *msh, t_command *cmd)
i = 0; i = 0;
while (cmd->args[++i] != NULL) while (cmd->args[++i] != NULL)
{ {
arr = ft_split(cmd->args[i], '='); arr = ft_split_safe(msh, cmd->args[i], '=');
if (arr[1] == NULL) if (arr[1] == NULL)
{ {
ft_free_arr_safe(msh, arr); ft_free_arr_safe(msh, arr);

View File

@ -6,7 +6,7 @@
/* By: willem <willem@student.codam.nl> +#+ */ /* By: willem <willem@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/08 17:00:24 by willem #+# #+# */ /* Created: 2025/02/08 17:00:24 by willem #+# #+# */
/* Updated: 2025/03/01 14:24:46 by whaffman ######## odam.nl */ /* Updated: 2025/03/02 22:20:30 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -52,7 +52,7 @@ char *executor_absolute_path(t_minishell *msh, char *cmd)
path_env = environment_get(msh, "PATH"); path_env = environment_get(msh, "PATH");
if (!path_env) if (!path_env)
return (NULL); return (NULL);
path = ft_split(path_env->value, ':'); path = ft_split_safe(msh, path_env->value, ':');
i = 0; i = 0;
while (path[i] != NULL) while (path[i] != NULL)
{ {