Started from buttom go to the sky

This commit is contained in:
Raphaël 2024-04-28 19:59:01 +02:00
parent 96215449bd
commit f811e55dea
4781 changed files with 10121 additions and 1743 deletions

View file

@ -1,26 +0,0 @@
#include "../includes/minishell.h"
int main()
{
char *cwd;
size_t size;
cwd = (char *)malloc(size);
size = 1024;
if (cwd == NULL) {
perror("malloc");
exit(EXIT_FAILURE);
}
while (getcwd(cwd, size) == NULL) {
size *= 2;
cwd = (char *)realloc(cwd, size);
if (cwd == NULL) {
perror("realloc");
exit(EXIT_FAILURE);
}
}
printf("Le répertoire de travail actuel est : %s\n", cwd);
free(cwd); // N'oubliez pas de libérer la mémoire allouée
return 0;
}