Commit b5bfebec authored by Andreas Schwab's avatar Andreas Schwab

(send_process): Properly relocate pointer into data

when using encoded data.
parent 6dc43c2e
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.
......
......@@ -5745,7 +5745,9 @@ send_process (proc, buf, len, object)
/* 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 @@ send_process (proc, buf, len, object)
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment