Lines Matching refs:pwd
1 /* $NetBSD: pwd.c,v 1.23 2021/11/16 16:57:15 kre Exp $ */
40 static char sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
42 __RCSID("$NetBSD: pwd.c,v 1.23 2021/11/16 16:57:15 kre Exp $");
66 * (Some scripts run /bin/pwd in order to get 'pwd -P'.)
121 char *pwd;
124 /* Check $PWD -- if it's right, it's fast. */
125 pwd = getenv("PWD");
126 if (pwd == NULL)
128 if (pwd[0] != '/')
130 if (strstr(pwd, "/./") != NULL)
132 if (strstr(pwd, "/../") != NULL)
134 if (stat(pwd, &s_pwd) == -1 || stat(".", &s_dot) == -1)
138 return pwd;