aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <[email protected]>2006-07-12 08:37:45 +0000
committerYAMAMOTO Mitsuharu <[email protected]>2006-07-12 08:37:45 +0000
commit67c08d6c724409dec6e87005c4418ee85a4bf4ec (patch)
tree8cd17be39d8a5676f15b8db8a4d4a9e108761656 /src/fileio.c
parentb91834c328d3b310e3ebb7094c926e3f4787f07b (diff)
Include blockinput.h.
(Fexpand_file_name, search_embedded_absfilename): Add BLOCK_INPUT around getpwnam. (search_embedded_absfilename): Remove spurious xfree.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c
index b4fc934900..21e6fd3a86 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -77,6 +77,7 @@ extern int errno;
#include "charset.h"
#include "coding.h"
#include "window.h"
+#include "blockinput.h"
#ifdef WINDOWSNT
#define NOMINMAX 1
@@ -1386,7 +1387,9 @@ See also the function `substitute-in-file-name'. */)
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 @@ See also the function `substitute-in-file-name'.")
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 @@ search_embedded_absfilename (nm, endp)
/* 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;