Do not use getlogin, it's different (and/or broken) on AIX

Removed external variable `sp'


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@495 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-05-05 04:39:12 +00:00
parent 9ee4b90dd8
commit d550c631e9

View File

@@ -43,6 +43,7 @@ main(int argc, char **argv)
int ch, top; int ch, top;
struct passwd *pw = NULL; struct passwd *pw = NULL;
char *cp, homedir[MAXPATHLEN]; char *cp, homedir[MAXPATHLEN];
struct servent *sp;
sp = getservbyname("ftp", "tcp"); sp = getservbyname("ftp", "tcp");
if (sp == 0) if (sp == 0)
@@ -98,12 +99,7 @@ main(int argc, char **argv)
/* /*
* Set up the home directory in case we're globbing. * Set up the home directory in case we're globbing.
*/ */
cp = getlogin(); pw = getpwuid(getuid());
if (cp != NULL) {
pw = getpwnam(cp);
}
if (pw == NULL)
pw = getpwuid(getuid());
if (pw != NULL) { if (pw != NULL) {
home = homedir; home = homedir;
(void) strcpy(home, pw->pw_dir); (void) strcpy(home, pw->pw_dir);