-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_pwd.c
26 lines (23 loc) · 1.06 KB
/
ft_pwd.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_pwd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mavileo <mavileo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/23 18:51:00 by mavileo #+# #+# */
/* Updated: 2020/07/25 03:35:56 by mavileo ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int ft_pwd(char **args)
{
char *path;
(void)args;
path = getcwd(NULL, 0);
if (path == NULL)
return (1);
ft_putendl_fd(path, 1);
free(path);
return (0);
}