diff options
| author | Andreas Schwab | 2009-02-10 22:32:39 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2009-02-10 22:32:39 +0000 |
| commit | b5bfebec1323223a0cda471546658ff1bbeaec86 (patch) | |
| tree | 865f15da6021b1acb82a8884c66d5201f5c99dad /src | |
| parent | 6dc43c2e2dca3c212e2125d2dd5a8452eea63077 (diff) | |
| download | emacs-b5bfebec1323223a0cda471546658ff1bbeaec86.tar.gz emacs-b5bfebec1323223a0cda471546658ff1bbeaec86.zip | |
(send_process): Properly relocate pointer into data
when using encoded data.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/process.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3db96f64fca..e6f380e2db4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-02-10 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * process.c (send_process): Properly relocate pointer into data | ||
| 4 | when using encoded data. | ||
| 5 | |||
| 1 | 2009-02-08 ARISAWA Akihiro <ari@mbf.sphere.ne.jp> | 6 | 2009-02-08 ARISAWA Akihiro <ari@mbf.sphere.ne.jp> |
| 2 | 7 | ||
| 3 | * coding.c (detect_coding_charset): Fix previous change. | 8 | * coding.c (detect_coding_charset): Fix previous change. |
diff --git a/src/process.c b/src/process.c index 892a779a1c2..10b3b714d54 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5745,7 +5745,9 @@ send_process (proc, buf, len, object) | |||
| 5745 | 5745 | ||
| 5746 | /* Running filters might relocate buffers or strings. | 5746 | /* Running filters might relocate buffers or strings. |
| 5747 | Arrange to relocate BUF. */ | 5747 | Arrange to relocate BUF. */ |
| 5748 | if (BUFFERP (object)) | 5748 | if (CODING_REQUIRE_ENCODING (coding)) |
| 5749 | offset = buf - SDATA (coding->dst_object); | ||
| 5750 | else if (BUFFERP (object)) | ||
| 5749 | offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); | 5751 | offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); |
| 5750 | else if (STRINGP (object)) | 5752 | else if (STRINGP (object)) |
| 5751 | offset = buf - SDATA (object); | 5753 | offset = buf - SDATA (object); |
| @@ -5756,7 +5758,9 @@ send_process (proc, buf, len, object) | |||
| 5756 | wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0); | 5758 | wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0); |
| 5757 | #endif | 5759 | #endif |
| 5758 | 5760 | ||
| 5759 | if (BUFFERP (object)) | 5761 | if (CODING_REQUIRE_ENCODING (coding)) |
| 5762 | buf = offset + SDATA (coding->dst_object); | ||
| 5763 | else if (BUFFERP (object)) | ||
| 5760 | buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); | 5764 | buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); |
| 5761 | else if (STRINGP (object)) | 5765 | else if (STRINGP (object)) |
| 5762 | buf = offset + SDATA (object); | 5766 | buf = offset + SDATA (object); |