changeset 101932:06f397da7b55

(send_process): Properly relocate pointer into data when using encoded data.
author Andreas Schwab <schwab@suse.de>
date Tue, 10 Feb 2009 22:32:39 +0000
parents 8e4895e46810
children f9435803466a
files src/ChangeLog src/process.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Feb 10 10:26:53 2009 +0000
+++ b/src/ChangeLog	Tue Feb 10 22:32:39 2009 +0000
@@ -1,3 +1,8 @@
+2009-02-10  Andreas Schwab  <schwab@suse.de>
+
+	* process.c (send_process): Properly relocate pointer into data
+	when using encoded data.
+
 2009-02-08  ARISAWA Akihiro  <ari@mbf.sphere.ne.jp>
 
 	* coding.c (detect_coding_charset): Fix previous change.
--- a/src/process.c	Tue Feb 10 10:26:53 2009 +0000
+++ b/src/process.c	Tue Feb 10 22:32:39 2009 +0000
@@ -5745,7 +5745,9 @@
 
 		      /* Running filters might relocate buffers or strings.
 			 Arrange to relocate BUF.  */
-		      if (BUFFERP (object))
+		      if (CODING_REQUIRE_ENCODING (coding))
+			offset = buf - SDATA (coding->dst_object);
+		      else if (BUFFERP (object))
 			offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf);
 		      else if (STRINGP (object))
 			offset = buf - SDATA (object);
@@ -5756,7 +5758,9 @@
 		      wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0);
 #endif
 
-		      if (BUFFERP (object))
+		      if (CODING_REQUIRE_ENCODING (coding))
+			buf = offset + SDATA (coding->dst_object);
+		      else if (BUFFERP (object))
 			buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset);
 		      else if (STRINGP (object))
 			buf = offset + SDATA (object);