builtins cd, pwd (todo, refactoring cd)

This commit is contained in:
LuckyLaszlo
2021-12-05 01:01:27 +01:00
parent 27c00a78a0
commit c3a9035622
5 changed files with 78 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/01 17:16:30 by lperrey #+# #+# */
/* Updated: 2021/12/01 17:19:02 by lperrey ### ########.fr */
/* Updated: 2021/12/04 19:09:34 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -24,3 +24,18 @@ void shell_error(char *s1, char *s2)
write(STDERR_FILENO, s2, ft_strlen(s2));
write(STDERR_FILENO, "\n", 1);
}
void shell_perror(char *s1, char *s2, char *s3)
{
char *prefix;
prefix = "minishell: ";
write(STDERR_FILENO, prefix, ft_strlen(prefix));
if (s1)
write(STDERR_FILENO, s1, ft_strlen(s1));
if (s2)
write(STDERR_FILENO, s2, ft_strlen(s2));
if (s3)
write(STDERR_FILENO, s3, ft_strlen(s3));
perror(NULL);
}