summaryrefslogtreecommitdiffstats
path: root/src/b_cd.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-15 15:18:46 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-15 15:18:46 +0200
commit2ad9527e08febe415c01510b39ec1b927960b176 (patch)
tree033e6732ec8640fa249d743c327bef95ed773353 /src/b_cd.c
parent&& and || works pretty bav (diff)
download42-minishell-2ad9527e08febe415c01510b39ec1b927960b176.tar.gz
42-minishell-2ad9527e08febe415c01510b39ec1b927960b176.tar.bz2
42-minishell-2ad9527e08febe415c01510b39ec1b927960b176.tar.xz
42-minishell-2ad9527e08febe415c01510b39ec1b927960b176.tar.zst
42-minishell-2ad9527e08febe415c01510b39ec1b927960b176.zip
Cleaner
Diffstat (limited to '')
-rw-r--r--src/b_cd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/b_cd.c b/src/b_cd.c
index 9833172..2248a89 100644
--- a/src/b_cd.c
+++ b/src/b_cd.c
@@ -28,11 +28,11 @@ static void
char *args[],
t_msh *msh)
{
- if (!(*path = ft_strdup(*args)))
+ if ((*path = ft_strdup(*args)) == NULL)
{
f_alloc_and_destroy_msh(msh);
}
- if (!ft_strncmp("~/", *path, 2) || !ft_strncmp("~", *path, 2))
+ if (ft_strncmp("~/", *path, 2) == 0 || !ft_strncmp("~", *path, 2))
{
if (!(*path = ft_strsubst(*path,
"~", u_get_var_value("$HOME", msh))))