28 if (chdir(home) == -1)
30 perror(
"minishell: cd");
46 if (chdir(oldpwd) == -1)
48 shell_error(
"cd", oldpwd,
"No such file or directory");
51 ft_putendl_fd(oldpwd, STDOUT_FILENO);
64 shell_error(
"cd", arg,
"No such file or directory");
69 if (chdir(new_pwd) == -1)
71 shell_error(
"cd", arg,
"No such file or directory");
static int cd_path(t_shell *shell, char *arg)
int builtin_cd(t_shell *shell, t_cmd *cmd)
static int cd_home(t_shell *shell)
static int cd_oldpwd(t_shell *shell)
int change_dir(t_shell *shell, char *new_pwd)
char * compute_logical_pwd(t_shell *shell, char *arg)
char * get_env_value(t_list *env_list, char *key)
Environment listesinde key'e göre değer döndürür.
void shell_error(char *cmd, char *arg, char *msg)
Minishell ana header dosyası
int ft_strcmp(const char *s1, const char *s2)