aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
authorGlenn Morris2012-12-05 22:17:10 -0800
committerGlenn Morris2012-12-05 22:17:10 -0800
commitd8ad4d3ff9dcea9c581d72e1e9ec292ea18673b1 (patch)
tree511f16e150fca1ed64ec71800eb0e62a9d95578a /src/callproc.c
parentb7f3003fdd2e6baacddcd7657708e887a6580785 (diff)
parente1d51545ced3cf6f58c44891563dfaf62c34b411 (diff)
downloademacs-d8ad4d3ff9dcea9c581d72e1e9ec292ea18673b1.tar.gz
emacs-d8ad4d3ff9dcea9c581d72e1e9ec292ea18673b1.zip
Merge from emacs-24; up to 2012-11-24T16:58:43Z!cyd@gnu.org
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);