summaryrefslogtreecommitdiffstats
path: root/src/ft_s_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 16:40:34 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 16:40:34 +0200
commite42601eb5acc07417b217dfed4e9ab8cbb91794f (patch)
tree76e7dacd2e8d93012fecf2c29fcb4d14e6d1baed /src/ft_s_init.c
parent(fd)>qwe fd agregation redir works (diff)
download42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.gz
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.bz2
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.xz
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.zst
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.zip
Stupid bash rule
Diffstat (limited to 'src/ft_s_init.c')
-rw-r--r--src/ft_s_init.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ft_s_init.c b/src/ft_s_init.c
index fb3ba6a..5de17c1 100644
--- a/src/ft_s_init.c
+++ b/src/ft_s_init.c
@@ -24,15 +24,11 @@ t_msh
t_msh *msh;
if (!(msh = (t_msh*)malloc(sizeof(t_msh))))
- {
return (NULL);
- }
- if (!(msh->ps_one =
- (char*)malloc((ft_strlen(FT_PS_ONE) + 1) * sizeof(char))))
- {
+ if (!(msh->ps_one = ft_strdup(FT_PS_ONE)))
+ return (NULL);
+ if (!(msh->shname = ft_strdup(FT_DEFAULT_SHNAME)))
return (NULL);
- }
- ft_strlcpy(msh->ps_one, FT_PS_ONE, ft_strlen(FT_PS_ONE) + 1);
msh->cwd = NULL;
msh->cwd = getcwd(NULL, 0);
/* TODO: handle getcwd failed */