mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-04 08:15:15 +00:00
moved cwd stuff
This commit is contained in:
19
find_path.c
19
find_path.c
@@ -80,11 +80,6 @@ extern int fprintf();
|
|||||||
extern int readlink();
|
extern int readlink();
|
||||||
extern int stat();
|
extern int stat();
|
||||||
extern int lstat();
|
extern int lstat();
|
||||||
#ifdef HAVE_GETCWD
|
|
||||||
extern char *getcwd();
|
|
||||||
#else
|
|
||||||
extern char *getwd();
|
|
||||||
#endif /* HAVE_GETCWD */
|
|
||||||
#ifdef HAVE_STRDUP
|
#ifdef HAVE_STRDUP
|
||||||
extern char *strdup();
|
extern char *strdup();
|
||||||
#endif /* HAVE_STRDUP */
|
#endif /* HAVE_STRDUP */
|
||||||
@@ -226,17 +221,9 @@ char *qualify(n)
|
|||||||
/*
|
/*
|
||||||
* if n is relative, fill full with working dir
|
* if n is relative, fill full with working dir
|
||||||
*/
|
*/
|
||||||
if (*n != '/') {
|
if (*n != '/')
|
||||||
#ifdef HAVE_GETCWD
|
(void) strcpy(full, cwd);
|
||||||
if (!getcwd(full, (size_t) (MAXPATHLEN + 1))) {
|
else
|
||||||
#else
|
|
||||||
if (!getwd(full)) {
|
|
||||||
#endif /* HAVE_GETCWD */
|
|
||||||
(void) fprintf(stderr, "%s: Can't get working directory!\n",
|
|
||||||
Argv[0]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
full[0] = '\0';
|
full[0] = '\0';
|
||||||
|
|
||||||
(void) strcpy(name, n); /* working copy... */
|
(void) strcpy(name, n); /* working copy... */
|
||||||
|
Reference in New Issue
Block a user