changeset 634:52d0ff659265

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 May 1992 20:13:17 +0000
parents 379b94c9f29e
children 197f38dd0105
files lib-src/movemail.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/movemail.c	Wed May 06 03:42:36 1992 +0000
+++ b/lib-src/movemail.c	Thu May 07 20:13:17 1992 +0000
@@ -392,6 +392,7 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <pwd.h>
 
 #ifdef USG
 #include <fcntl.h>
@@ -427,6 +428,9 @@
   register int i;
   int mbfi;
   FILE *mbf;
+  struct passwd *pw = (struct passwd *) getpwuid (getuid ());
+  if (pw == NULL)
+    fatal ("cannot determine user name");
 
   host = getenv ("MAILHOST");
   if (host == NULL)
@@ -445,7 +449,7 @@
     }
 
   if (pop_command ("USER %s", user) == NOTOK
-      || pop_command ("RPOP %s", user) == NOTOK)
+      || pop_command ("RPOP %s", pw->pw_name) == NOTOK)
     {
       pop_command ("QUIT");
       fatal (Errmsg);