1 /* pwd.c - replacement for broken pwd command.
2 * Copyright 1997 Guido Flohr, <gufl0000@stud.uni-sb.de>.
3 * Do with it as you please.
11 #if defined(__STDC__) || defined(__cplusplus)
12 int main (int argc, char* argv[])
19 char path_buf[PATH_MAX + 1];
25 fputs (argv[0], stderr);
26 fputs (": ignoring garbage arguments\n", stderr);
29 if (!getcwd (path_buf, PATH_MAX + 1)) {
31 /* Save space, memory and the whales, avoid fprintf. */
32 fputs (argv[0], stderr);
33 fputs (": can\'t get current working directory: ", stderr);
34 fputs (strerror (errno), stderr);
38 if (puts (path_buf) < 0) {