Blame SOURCES/netkit-ftp-0.17-getlogin.patch

04a9bc
--- netkit-ftp-0.17-dist/ftp/ftp.c	2012-10-02 14:44:06.328343277 +0200
04a9bc
+++ netkit-ftp-0.17-new/ftp/ftp.c	2012-10-03 09:07:47.381868330 +0200
04a9bc
@@ -328,14 +328,12 @@ dologin(const char *host)
04a9bc
 		return(0);
04a9bc
 	}
04a9bc
 	while (luser == NULL) {
04a9bc
-		char *myname = getlogin();
04a9bc
+		char *myname = NULL;
04a9bc
 
04a9bc
-		if (myname == NULL) {
04a9bc
-			struct passwd *pp = getpwuid(getuid());
04a9bc
+		struct passwd *pp = getpwuid(getuid());
04a9bc
 
04a9bc
-			if (pp != NULL)
04a9bc
-				myname = pp->pw_name;
04a9bc
-		}
04a9bc
+		if (pp != NULL)
04a9bc
+			myname = pp->pw_name;
04a9bc
 		if (myname)
04a9bc
 			printf("Name (%s:%s): ", host, myname);
04a9bc
 		else
04a9bc
--- netkit-ftp-0.17-dist/ftp/main.c	2012-10-02 14:44:06.330343274 +0200
04a9bc
+++ netkit-ftp-0.17-new/ftp/main.c	2012-10-03 09:07:36.849862227 +0200
04a9bc
@@ -204,12 +204,7 @@ main(volatile int argc, char **volatile
04a9bc
 	/*
04a9bc
 	 * Set up the home directory in case we're globbing.
04a9bc
 	 */
04a9bc
-	cp = getlogin();
04a9bc
-	if (cp != NULL) {
04a9bc
-		pw = getpwnam(cp);
04a9bc
-	}
04a9bc
-	if (pw == NULL)
04a9bc
-		pw = getpwuid(getuid());
04a9bc
+	pw = getpwuid(getuid());
04a9bc
 	if (pw != NULL) {
04a9bc
 		strncpy(homedir, pw->pw_dir, sizeof(homedir));
04a9bc
 		homedir[sizeof(homedir)-1] = 0;