diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-12-18 20:18:38 +0100 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-12-18 20:18:38 +0100 |
commit | bbc9757dccbc50fb051ca3cff585a9100023b1b1 (patch) | |
tree | cbf0c5280545d47cea0d7885e94c711edd4c5cc7 /src/s_init_next.c | |
parent | Merge branch 'leaktarace' of jozanleclerc.xyz:42-minishell into leaktarace (diff) | |
download | 42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.gz 42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.bz2 42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.xz 42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.tar.zst 42-minishell-bbc9757dccbc50fb051ca3cff585a9100023b1b1.zip |
qweqweqweqwe
Diffstat (limited to 'src/s_init_next.c')
-rw-r--r-- | src/s_init_next.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/s_init_next.c b/src/s_init_next.c index 6ee17d4..8ee3b7e 100644 --- a/src/s_init_next.c +++ b/src/s_init_next.c @@ -113,35 +113,3 @@ char **s_dupenv(char *const envp[]) nenvp[i] = NULL; return (nenvp); } - -void s_set_cwd(char cwd[], t_msh *msh) -{ - char fmt[PATH_MAX]; - DIR *dir; - - u_get_var_value(cwd, "$PWD", PATH_MAX, msh); - if (cwd[0] == C_NUL) - { - if (getcwd(cwd, PATH_MAX) != NULL) - { - ft_sprintf(fmt, "%s=%s", "PWD", cwd); - b_export_with_equals(fmt, msh); - } - else - ft_dprintf(STDERR_FILENO, "minishell: %s\n", strerror(errno)); - return ; - } - if ((dir = opendir(cwd)) != NULL) - closedir(dir); - else if (errno == ENOENT) - { - if (getcwd(cwd, PATH_MAX) != NULL) - { - ft_sprintf(fmt, "%s=%s", "PWD", cwd); - b_export_with_equals(fmt, msh); - } - else - ft_dprintf(STDERR_FILENO, "minishell: %s\n", strerror(errno)); - return ; - } -} |