Lines Matching refs:pwd
1 /* $NetBSD: pwd.c,v 1.21 2008/07/20 00:52:40 lukem Exp $ */
40 static char sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
42 __RCSID("$NetBSD: pwd.c,v 1.21 2008/07/20 00:52:40 lukem Exp $");
66 * (Some scripts run /bin/pwd in order to get 'pwd -P'.)
117 char *pwd;
121 pwd = getenv("PWD");
122 if (pwd == NULL)
124 if (pwd[0] != '/')
126 if (strstr(pwd, "/./") != NULL)
128 if (strstr(pwd, "/../") != NULL)
130 if (stat(pwd, &s_pwd) == -1 || stat(".", &s_dot) == -1)
134 return pwd;