diff options
| author | Kenichi Handa | 1998-07-16 00:14:44 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-07-16 00:14:44 +0000 |
| commit | 8bc49fd1f3a9cdcf01d8e9bfcc7046527778cef3 (patch) | |
| tree | 34d900e0137352eca8c306e53b4a7a8e74a40ed8 /src/process.c | |
| parent | 9959c16e4f83ba4798ffa089261d8f4b0a30361a (diff) | |
| download | emacs-8bc49fd1f3a9cdcf01d8e9bfcc7046527778cef3.tar.gz emacs-8bc49fd1f3a9cdcf01d8e9bfcc7046527778cef3.zip | |
(read_process_output): Even if we read data without
code conversion, calculate character counts. If we insert the
data into a unibyte buffer, treat the data as unibyte.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/process.c b/src/process.c index c8ee4b96ea9..4d362b95d1e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2911,21 +2911,24 @@ read_process_output (proc, channel) | |||
| 2911 | : coding->produced_char); | 2911 | : coding->produced_char); |
| 2912 | chars_in_decoding_buf = 1; | 2912 | chars_in_decoding_buf = 1; |
| 2913 | } | 2913 | } |
| 2914 | #ifdef VMS | 2914 | else |
| 2915 | else if (chars_allocated) | ||
| 2916 | { | 2915 | { |
| 2917 | /* Although we don't have to decode the received data, we must | 2916 | #ifdef VMS |
| 2918 | move it to an area which we don't have to free. */ | 2917 | if (chars_allocated) |
| 2919 | if (! STRINGP (p->decoding_buf) | 2918 | { |
| 2920 | || STRING_BYTES (XSTRING (p->decoding_buf)) < nbytes) | 2919 | /* Although we don't have to decode the received data, we |
| 2921 | p->decoding_buf = make_uninit_string (nbytes); | 2920 | must move it to an area which we don't have to free. */ |
| 2922 | bcopy (chars, XSTRING (p->decoding_buf)->data, nbytes); | 2921 | if (! STRINGP (p->decoding_buf) |
| 2923 | free (chars); | 2922 | || STRING_BYTES (XSTRING (p->decoding_buf)) < nbytes) |
| 2924 | chars = XSTRING (p->decoding_buf)->data; | 2923 | p->decoding_buf = make_uninit_string (nbytes); |
| 2924 | bcopy (chars, XSTRING (p->decoding_buf)->data, nbytes); | ||
| 2925 | free (chars); | ||
| 2926 | chars = XSTRING (p->decoding_buf)->data; | ||
| 2927 | chars_in_decoding_buf = 1; | ||
| 2928 | } | ||
| 2929 | #endif | ||
| 2925 | nchars = multibyte_chars_in_text (chars, nbytes); | 2930 | nchars = multibyte_chars_in_text (chars, nbytes); |
| 2926 | chars_in_decoding_buf = 1; | ||
| 2927 | } | 2931 | } |
| 2928 | #endif | ||
| 2929 | 2932 | ||
| 2930 | Vlast_coding_system_used = coding->symbol; | 2933 | Vlast_coding_system_used = coding->symbol; |
| 2931 | 2934 | ||
| @@ -3054,6 +3057,9 @@ read_process_output (proc, channel) | |||
| 3054 | if (! (BEGV <= PT && PT <= ZV)) | 3057 | if (! (BEGV <= PT && PT <= ZV)) |
| 3055 | Fwiden (); | 3058 | Fwiden (); |
| 3056 | 3059 | ||
| 3060 | if (NILP (current_buffer->enable_multibyte_characters)) | ||
| 3061 | nchars = nbytes; | ||
| 3062 | |||
| 3057 | /* Insert before markers in case we are inserting where | 3063 | /* Insert before markers in case we are inserting where |
| 3058 | the buffer's mark is, and the user's next command is Meta-y. */ | 3064 | the buffer's mark is, and the user's next command is Meta-y. */ |
| 3059 | if (chars_in_decoding_buf) | 3065 | if (chars_in_decoding_buf) |