Skip to content

Commit

Permalink
MAJ
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam GOOMANY committed Dec 18, 2016
1 parent 0dd69e5 commit 2a7dd63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions srcs/execution/builtin_cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: ulefebvr <ulefebvr@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/10/17 15:41:41 by ulefebvr #+# #+# */
/* Updated: 2016/12/18 18:09:41 by agoomany ### ########.fr */
/* Updated: 2016/12/18 18:21:51 by agoomany ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -57,12 +57,12 @@ int cd_go_to(t_info *info, char *destination, int flag)
tmp = NULL;
if (destination)
{
current = search_env_var(info, "PWD") ? search_env_var(info, "PWD") : 0;
current = search_env_var(info, "PWD") ?
ft_strdup(search_env_var(info, "PWD")->content) : 0;
if (!(++ret) || !(tmp = get_cleaned_dest(info, destination)) || !(++ret)
|| access(tmp, F_OK) == -1 || !(++ret) || chdir(tmp) == -1)
{
if (tmp)
free(tmp);
free(tmp);
free(current);
return (ret);
}
Expand Down

0 comments on commit 2a7dd63

Please sign in to comment.