exit sur la sortie d'erreure et parsing des variables $ mieux

This commit is contained in:
Tom Moron
2024-02-12 20:12:39 +01:00
parent f63d26dea7
commit 979e4e54a0
21 changed files with 33154 additions and 51 deletions

25
ft_pwd.c Executable file
View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_pwd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 18:31:21 by tomoron #+# #+# */
/* Updated: 2024/02/12 14:53:05 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int ft_pwd(void)
{
char *buffer;
buffer = malloc(1024 * 1024);
if (!buffer)
return (1);
getcwd(buffer, 1024 * 1024);
ft_printf("%s\n", buffer);
free(buffer);
return (0);
}