aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 2c3d31ba052..6153bc1b6c6 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -977,8 +977,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
977 { 977 {
978 USE_SAFE_ALLOCA; 978 USE_SAFE_ALLOCA;
979 Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); 979 Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir);
980 char *tempfile = SAFE_ALLOCA (SBYTES (pattern) + 1); 980 Lisp_Object encoded_tem = ENCODE_FILE (pattern);
981 memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); 981 char *tempfile = SAFE_ALLOCA (SBYTES (encoded_tem) + 1);
982 memcpy (tempfile, SDATA (encoded_tem), SBYTES (encoded_tem) + 1);
982 coding_systems = Qt; 983 coding_systems = Qt;
983 984
984#ifdef HAVE_MKSTEMP 985#ifdef HAVE_MKSTEMP
@@ -995,7 +996,15 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
995 close (fd); 996 close (fd);
996 } 997 }
997#else 998#else
999 errno = 0;
998 mktemp (tempfile); 1000 mktemp (tempfile);
1001 if (!*tempfile)
1002 {
1003 if (!errno)
1004 errno = EEXIST;
1005 report_file_error ("Failed to open temporary file using pattern",
1006 Fcons (pattern, Qnil));
1007 }
999#endif 1008#endif
1000 1009
1001 filename_string = build_string (tempfile); 1010 filename_string = build_string (tempfile);