diff options
Diffstat (limited to 'pwd.c')
-rw-r--r-- | pwd.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,12 +1,13 @@ | |||
1 | #include "internal.h" | 1 | #include "internal.h" |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <dirent.h> | ||
3 | 4 | ||
4 | const char pwd_usage[] = "Print the current directory.\n"; | 5 | const char pwd_usage[] = "Print the current directory.\n"; |
5 | 6 | ||
6 | extern int | 7 | extern int |
7 | pwd_main(int argc, char * * argv) | 8 | pwd_main(int argc, char * * argv) |
8 | { | 9 | { |
9 | char buf[1024]; | 10 | char buf[NAME_MAX]; |
10 | 11 | ||
11 | if ( getcwd(buf, sizeof(buf)) == NULL ) { | 12 | if ( getcwd(buf, sizeof(buf)) == NULL ) { |
12 | perror("get working directory"); | 13 | perror("get working directory"); |