Mercurial > emacs
comparison src/process.c @ 70517:7ebead4f6646
(setup_process_coding_systems): Use system_eol_type
for encoding if eol_type is not yet decided.
(read_process_output): Likewise.
(send_process): Likewise.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 08 May 2006 05:19:42 +0000 |
parents | 9fb9e33ecf2d |
children | 8e0e27268c74 1321f6cfb389 146cd8369025 |
comparison
equal
deleted
inserted
replaced
70516:767616c80562 | 70517:7ebead4f6646 |
---|---|
693 if (!proc_encode_coding_system[outch]) | 693 if (!proc_encode_coding_system[outch]) |
694 proc_encode_coding_system[outch] | 694 proc_encode_coding_system[outch] |
695 = (struct coding_system *) xmalloc (sizeof (struct coding_system)); | 695 = (struct coding_system *) xmalloc (sizeof (struct coding_system)); |
696 setup_coding_system (p->encode_coding_system, | 696 setup_coding_system (p->encode_coding_system, |
697 proc_encode_coding_system[outch]); | 697 proc_encode_coding_system[outch]); |
698 if (proc_encode_coding_system[outch]->eol_type == CODING_EOL_UNDECIDED) | |
699 proc_encode_coding_system[outch]->eol_type = system_eol_type; | |
698 } | 700 } |
699 | 701 |
700 DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, | 702 DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, |
701 doc: /* Return t if OBJECT is a process. */) | 703 doc: /* Return t if OBJECT is a process. */) |
702 (object) | 704 (object) |
5064 && proc_encode_coding_system[XINT (p->outfd)]) | 5066 && proc_encode_coding_system[XINT (p->outfd)]) |
5065 { | 5067 { |
5066 p->encode_coding_system = coding->symbol; | 5068 p->encode_coding_system = coding->symbol; |
5067 setup_coding_system (coding->symbol, | 5069 setup_coding_system (coding->symbol, |
5068 proc_encode_coding_system[XINT (p->outfd)]); | 5070 proc_encode_coding_system[XINT (p->outfd)]); |
5071 if (proc_encode_coding_system[XINT (p->outfd)]->eol_type | |
5072 == CODING_EOL_UNDECIDED) | |
5073 proc_encode_coding_system[XINT (p->outfd)]->eol_type | |
5074 = system_eol_type; | |
5069 } | 5075 } |
5070 } | 5076 } |
5071 | 5077 |
5072 carryover = nbytes - coding->consumed; | 5078 carryover = nbytes - coding->consumed; |
5073 if (SCHARS (p->decoding_buf) < carryover) | 5079 if (SCHARS (p->decoding_buf) < carryover) |
5171 && proc_encode_coding_system[XINT (p->outfd)]) | 5177 && proc_encode_coding_system[XINT (p->outfd)]) |
5172 { | 5178 { |
5173 p->encode_coding_system = coding->symbol; | 5179 p->encode_coding_system = coding->symbol; |
5174 setup_coding_system (coding->symbol, | 5180 setup_coding_system (coding->symbol, |
5175 proc_encode_coding_system[XINT (p->outfd)]); | 5181 proc_encode_coding_system[XINT (p->outfd)]); |
5182 if (proc_encode_coding_system[XINT (p->outfd)]->eol_type | |
5183 == CODING_EOL_UNDECIDED) | |
5184 proc_encode_coding_system[XINT (p->outfd)]->eol_type | |
5185 = system_eol_type; | |
5176 } | 5186 } |
5177 } | 5187 } |
5178 carryover = nbytes - coding->consumed; | 5188 carryover = nbytes - coding->consumed; |
5179 if (SCHARS (p->decoding_buf) < carryover) | 5189 if (SCHARS (p->decoding_buf) < carryover) |
5180 p->decoding_buf = make_uninit_string (carryover); | 5190 p->decoding_buf = make_uninit_string (carryover); |
5313 /* The coding system for encoding was changed to raw-text | 5323 /* The coding system for encoding was changed to raw-text |
5314 because we sent a unibyte text previously. Now we are | 5324 because we sent a unibyte text previously. Now we are |
5315 sending a multibyte text, thus we must encode it by the | 5325 sending a multibyte text, thus we must encode it by the |
5316 original coding system specified for the current process. */ | 5326 original coding system specified for the current process. */ |
5317 setup_coding_system (p->encode_coding_system, coding); | 5327 setup_coding_system (p->encode_coding_system, coding); |
5328 if (coding->eol_type == CODING_EOL_UNDECIDED) | |
5329 coding->eol_type = system_eol_type; | |
5318 /* src_multibyte should be set to 1 _after_ a call to | 5330 /* src_multibyte should be set to 1 _after_ a call to |
5319 setup_coding_system, since it resets src_multibyte to | 5331 setup_coding_system, since it resets src_multibyte to |
5320 zero. */ | 5332 zero. */ |
5321 coding->src_multibyte = 1; | 5333 coding->src_multibyte = 1; |
5322 } | 5334 } |