Lines Matching full:pwd
1 /* pwd.c - Print working directory.
5 * See http://opengroup.org/onlinepubs/9699919799/utilities/pwd.html
7 USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
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; in pwd_main() local
28 // Only use $PWD if it's an absolute path alias for cwd with no "." or ".." in pwd_main()
29 if (!FLAG(P) && (s = PWD = getenv("PWD"))) { in pwd_main()
39 if (!*s && s != PWD) s = PWD; in pwd_main()
43 if (s && pwd) in pwd_main()
44 if (stat(pwd, &st1) || stat(PWD, &st2) || !same_file(&st1, &st2)) s = 0; in pwd_main()
48 if (s || (s = pwd)) puts(s); in pwd_main()
49 free(pwd); in pwd_main()