Home | History | Annotate | Download | only in posix

Lines Matching refs:PWD

0 /* pwd.c - Print working directory.
5 * See http://opengroup.org/onlinepubs/9699919799/utilities/pwd.html
7 USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
9 config PWD
10 bool "pwd"
13 usage: pwd [-L|-P]
17 -L Use shell's path from $PWD (when applicable)
26 char *s, *pwd = getcwd(0, 0), *PWD;
28 // Only use $PWD if it's an absolute path alias for cwd with no "." or ".."
29 if (!(toys.optflags & FLAG_P) && (s = PWD = getenv("PWD"))) {
39 if (!*s && s != PWD) s = PWD;
43 if (s && pwd)
44 if (stat(pwd, &st1) || stat(PWD, &st2) || st1.st_ino != st2.st_ino ||
49 if (!s && !(s = pwd)) perror_exit("xgetcwd");
53 if (CFG_TOYBOX_FREE) free(pwd);