diff options
author | Eric Andersen | 2001-04-09 22:48:12 +0000 |
---|---|---|
committer | Eric Andersen | 2001-04-09 22:48:12 +0000 |
commit | e5dfced23a904d08afa5dcee190c3c3d845d9f50 (patch) | |
tree | ef367ee8a9096884fb40debdc9e10af8583f9d5f /pwd.c | |
parent | a75e2867435faa68ea03735fe09ad298fa3e4e72 (diff) | |
download | busybox-e5dfced23a904d08afa5dcee190c3c3d845d9f50.zip busybox-e5dfced23a904d08afa5dcee190c3c3d845d9f50.tar.gz |
Apply Vladimir's latest cleanup patch.
-Erik
Diffstat (limited to 'pwd.c')
-rw-r--r-- | pwd.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -32,11 +32,13 @@ extern int pwd_main(int argc, char **argv) { - char buf[BUFSIZ + 1]; - - if (getcwd(buf, sizeof(buf)) == NULL) - perror_msg_and_die("getcwd"); - - puts(buf); - return EXIT_SUCCESS; + static char *buf; + + buf = xgetcwd(buf); + + if (buf != NULL) { + puts(buf); + return EXIT_SUCCESS; + } + return EXIT_FAILURE; } |