changeset 41528:e6244d9fb1c6

(Fcall_process): When we make a bigger buffer for bufptr, don't lose the data in it.
author Richard M. Stallman <rms@gnu.org>
date Mon, 26 Nov 2001 00:36:28 +0000
parents b5d7677d0f20
children 370b4ba3f429
files src/callproc.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/callproc.c	Mon Nov 26 00:34:09 2001 +0000
+++ b/src/callproc.c	Mon Nov 26 00:36:28 2001 +0000
@@ -897,8 +897,12 @@
 	   but not past 64k.  */
 	if (bufsize < 64 * 1024 && total_read > 32 * bufsize)
 	  {
+	    char *tempptr;
 	    bufsize *= 2;
-	    bufptr = (char *) alloca (bufsize);
+
+	    tempptr = (char *) alloca (bufsize);
+	    bcopy (bufptr, tempptr, bufsize / 2);
+	    bufptr = tempptr;
 	  }
 
 	if (!NILP (display) && INTERACTIVE)