add ls; simpler pwd

This commit is contained in:
Connor Lane Smith
2011-05-26 04:01:20 +01:00
parent 273f150c84
commit 6ef3d9174b
9 changed files with 268 additions and 24 deletions

12
pwd.c
View File

@@ -7,16 +7,6 @@
int
main(void)
{
char *buf;
long size;
if((size = pathconf(".", _PC_PATH_MAX)) < 0)
size = BUFSIZ;
if(!(buf = malloc(size)))
eprintf("malloc:");
if(!getcwd(buf, size))
eprintf("getcwd:");
puts(buf);
puts(agetcwd());
return EXIT_SUCCESS;
}