Mercurial > emacs
diff lib-src/movemail.c @ 634:52d0ff659265
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 07 May 1992 20:13:17 +0000 |
parents | 63a8e7b3c547 |
children | 62dd28940dc6 |
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);