\f
-char *getenv (const char *), *getwd (char *);
-#ifdef HAVE_GETCWD
-char *(getcwd) (char *, size_t);
-#endif
+char *getenv (const char *);
#ifndef VERSION
#define VERSION "unspecified"
char *buf;
const char *pwd;
struct stat dotstat, pwdstat;
- /* If PWD is accurate, use it instead of calling getwd. PWD is
+ /* If PWD is accurate, use it instead of calling getcwd. PWD is
sometimes a nicer name, and using it may avoid a fatal error if a
parent directory is searchable but not readable. */
if ((pwd = egetenv ("PWD")) != 0
buf = (char *) xmalloc (strlen (pwd) + 1);
strcpy (buf, pwd);
}
-#ifdef HAVE_GETCWD
else
{
size_t buf_size = 1024;
}
}
}
-#else
- else
- {
- /* We need MAXPATHLEN here. */
- buf = (char *) xmalloc (MAXPATHLEN + 1);
- if (getwd (buf) == NULL)
- {
- int tmp_errno = errno;
- free (buf);
- errno = tmp_errno;
- return NULL;
- }
- }
-#endif
return buf;
}
#endif
cwd = get_current_dir_name ();
if (cwd == 0)
{
- /* getwd puts message in STRING if it fails. */
message (TRUE, "%s: %s\n", progname,
"Cannot get current working directory");
fail ();