This commit is contained in:
Connor Lane Smith
2011-06-25 17:26:44 +01:00
parent 572f5e926c
commit 33de3bffdb
5 changed files with 28 additions and 10 deletions

View File

@@ -1,6 +1,4 @@
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../util.h"
@@ -10,10 +8,7 @@ agetcwd(void)
char *buf;
long size;
if((size = pathconf(".", _PC_PATH_MAX)) == -1)
size = BUFSIZ;
if(!(buf = malloc(size)))
eprintf("malloc:");
apathmax(&buf, &size);
if(!getcwd(buf, size))
eprintf("getcwd:");
return buf;