emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113439: Fix w32 bug with call-process-region.


From: Paul Eggert
Subject: [Emacs-diffs] trunk r113439: Fix w32 bug with call-process-region.
Date: Tue, 16 Jul 2013 22:40:20 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113439
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14885
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2013-07-16 15:40:17 -0700
message:
  Fix w32 bug with call-process-region.
  
  * callproc.c (Fcall_process_region): Pass nil, not "/dev/null",
  to Fcall_process when the input is empty.  This simplifies the
  code a bit.  It makes no difference on POSIXish platforms but
  apparently it fixes a bug on w32.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/callproc.c                 callproc.c-20091113204419-o5vbwnq5f7feedwu-248
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-07-16 21:49:32 +0000
+++ b/src/ChangeLog     2013-07-16 22:40:17 +0000
@@ -1,6 +1,12 @@
 2013-07-16  Paul Eggert  <address@hidden>
 
-       Fix bug where Emacs tries to close a file twice (Bug#14839).
+       Fix w32 bug with call-process-region (Bug#14885).
+       * callproc.c (Fcall_process_region): Pass nil, not "/dev/null",
+       to Fcall_process when the input is empty.  This simplifies the
+       code a bit.  It makes no difference on POSIXish platforms but
+       apparently it fixes a bug on w32.
+
+       Fix bug where insert-file-contents closes a file twice. (Bug#14839).
        * fileio.c (close_file_unwind): Don't close if FD is negative;
        this can happen when unwinding a zapped file descriptor.
        (Finsert_file_contents): Unwind-protect the fd before the point marker,

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2013-07-16 21:35:45 +0000
+++ b/src/callproc.c    2013-07-16 22:40:17 +0000
@@ -1093,7 +1093,7 @@
   (ptrdiff_t nargs, Lisp_Object *args)
 {
   struct gcpro gcpro1;
-  Lisp_Object filename_string;
+  Lisp_Object infile;
   ptrdiff_t count = SPECPDL_INDEX ();
   Lisp_Object start = args[0];
   Lisp_Object end = args[1];
@@ -1111,10 +1111,8 @@
       empty_input = XINT (start) == XINT (end);
     }
 
-  filename_string = (empty_input
-                    ? build_string (NULL_DEVICE)
-                    : create_temp_file (nargs, args));
-  GCPRO1 (filename_string);
+  infile = empty_input ? Qnil : create_temp_file (nargs, args);
+  GCPRO1 (infile);
 
   if (nargs > 3 && !NILP (args[3]))
     Fdelete_region (start, end);
@@ -1129,7 +1127,7 @@
       args[0] = args[2];
       nargs = 2;
     }
-  args[1] = filename_string;
+  args[1] = infile;
 
   RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args)));
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]