2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

moved cwd stuff

This commit is contained in:
Todd C. Miller
1994-05-24 20:17:43 +00:00
parent eba71ad921
commit f12f25204d

View File

@@ -80,11 +80,6 @@ extern int fprintf();
extern int readlink();
extern int stat();
extern int lstat();
#ifdef HAVE_GETCWD
extern char *getcwd();
#else
extern char *getwd();
#endif /* HAVE_GETCWD */
#ifdef HAVE_STRDUP
extern char *strdup();
#endif /* HAVE_STRDUP */
@@ -226,17 +221,9 @@ char *qualify(n)
/*
* if n is relative, fill full with working dir
*/
if (*n != '/') {
#ifdef HAVE_GETCWD
if (!getcwd(full, (size_t) (MAXPATHLEN + 1))) {
#else
if (!getwd(full)) {
#endif /* HAVE_GETCWD */
(void) fprintf(stderr, "%s: Can't get working directory!\n",
Argv[0]);
exit(1);
}
} else
if (*n != '/')
(void) strcpy(full, cwd);
else
full[0] = '\0';
(void) strcpy(name, n); /* working copy... */