# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1152693465 0 # Node ID 086c76517b02704d64c819521f3afd8b2ad18058 # Parent fb57c183078864ac6cceb9c5c21b56349d2afb00 Include blockinput.h. (Fexpand_file_name, search_embedded_absfilename): Add BLOCK_INPUT around getpwnam. (search_embedded_absfilename): Remove spurious xfree. diff -r fb57c1830788 -r 086c76517b02 src/fileio.c --- a/src/fileio.c Wed Jul 12 08:37:25 2006 +0000 +++ b/src/fileio.c Wed Jul 12 08:37:45 2006 +0000 @@ -77,6 +77,7 @@ #include "charset.h" #include "coding.h" #include "window.h" +#include "blockinput.h" #ifdef WINDOWSNT #define NOMINMAX 1 @@ -1386,7 +1387,9 @@ bcopy ((char *) nm, o, p - nm); o [p - nm] = 0; + BLOCK_INPUT; pw = (struct passwd *) getpwnam (o + 1); + UNBLOCK_INPUT; if (pw) { newdir = (unsigned char *) pw -> pw_dir; @@ -1917,7 +1920,9 @@ o[len] = 0; /* Look up the user name. */ + BLOCK_INPUT; pw = (struct passwd *) getpwnam (o + 1); + UNBLOCK_INPUT; if (!pw) error ("\"%s\" isn't a registered user", o + 1); @@ -2111,10 +2116,11 @@ /* If we have ~user and `user' exists, discard everything up to ~. But if `user' does not exist, leave ~user alone, it might be a literal file name. */ - if ((pw = getpwnam (o + 1))) + BLOCK_INPUT; + pw = getpwnam (o + 1); + UNBLOCK_INPUT; + if (pw) return p; - else - xfree (pw); } else return p;