diff options
| author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-24 19:51:45 +0200 | 
|---|---|---|
| committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-24 19:51:45 +0200 | 
| commit | d2570eca22dc09dab77930c2a4de3ba9ebcbcdab (patch) | |
| tree | 954724f58451f7572ff727818876c17eab10d394 /src | |
| parent | Freed leaks, fix in progress (diff) | |
| download | 42-minishell-d2570eca22dc09dab77930c2a4de3ba9ebcbcdab.tar.gz 42-minishell-d2570eca22dc09dab77930c2a4de3ba9ebcbcdab.tar.bz2 42-minishell-d2570eca22dc09dab77930c2a4de3ba9ebcbcdab.tar.xz 42-minishell-d2570eca22dc09dab77930c2a4de3ba9ebcbcdab.tar.zst 42-minishell-d2570eca22dc09dab77930c2a4de3ba9ebcbcdab.zip | |
pwd fix
Diffstat (limited to '')
| -rw-r--r-- | src/b_cd.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| @@ -83,7 +83,7 @@ static void  		}  		else  		{ -			j = ft_strlen(repath) + 1; +			j = (ft_strncmp(repath, "/", 2) == 0) ? (1) : (ft_strlen(repath) + 1);  			repath[j - 1] = '/';  			ft_strlcpy(repath + j, splited[i], ft_strlen(splited[i]) + 1);  		} @@ -113,7 +113,6 @@ static void  		ft_delwords(splited);  	}  	repath[0] = (repath[0] == '\0') ? '/' : repath[0]; -	ft_printf("[%s]\n", repath);  	ft_sprintf(fmt, "%s=%s", "PWD", repath);  	b_export_with_equals(fmt, msh);  	ft_memdel((void*)&msh->cwd); @@ -137,7 +136,8 @@ uint8_t  	{  		if ((path = u_get_var_value("$HOME", msh)) == NULL)  		{ -			ft_dprintf(STDERR_FILENO, "minishell: cd: %s\n", FT_FAIL_HOME_NOT_SET); +			ft_dprintf(STDERR_FILENO, "minishell: cd: %s\n", +				FT_FAIL_HOME_NOT_SET);  			return (2);  		}  	} | 
