Mercurial > emacs
comparison src/callproc.c @ 23079:0e2635f13ea9 EMACS_20_3
(Fcall_process): Use malloc for decoding_buf.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 19 Aug 1998 17:44:21 +0000 |
parents | 3cfe86230c87 |
children | aaad8461ff34 |
comparison
equal
deleted
inserted
replaced
23078:18d2ab8a8a62 | 23079:0e2635f13ea9 |
---|---|
675 if (process_coding.type == coding_type_no_conversion) | 675 if (process_coding.type == coding_type_no_conversion) |
676 insert (bufptr, nread); | 676 insert (bufptr, nread); |
677 else | 677 else |
678 { /* We have to decode the input. */ | 678 { /* We have to decode the input. */ |
679 int size = decoding_buffer_size (&process_coding, nread); | 679 int size = decoding_buffer_size (&process_coding, nread); |
680 char *decoding_buf = (char *) alloca (size); | 680 char *decoding_buf = (char *) malloc (size); |
681 | 681 |
682 decode_coding (&process_coding, bufptr, decoding_buf, | 682 decode_coding (&process_coding, bufptr, decoding_buf, |
683 nread, size); | 683 nread, size); |
684 if (display_on_the_fly | 684 if (display_on_the_fly |
685 && saved_coding.type == coding_type_undecided | 685 && saved_coding.type == coding_type_undecided |
687 { | 687 { |
688 /* We have detected some coding system. But, | 688 /* We have detected some coding system. But, |
689 there's a possibility that the detection was | 689 there's a possibility that the detection was |
690 done by insufficient data. So, we give up | 690 done by insufficient data. So, we give up |
691 displaying on the fly. */ | 691 displaying on the fly. */ |
692 free (decoding_buf); | |
692 display_on_the_fly = 0; | 693 display_on_the_fly = 0; |
693 process_coding = saved_coding; | 694 process_coding = saved_coding; |
694 carryover = nread; | 695 carryover = nread; |
695 continue; | 696 continue; |
696 } | 697 } |
697 if (process_coding.produced > 0) | 698 if (process_coding.produced > 0) |
698 insert (decoding_buf, process_coding.produced); | 699 insert (decoding_buf, process_coding.produced); |
700 free (decoding_buf); | |
699 carryover = nread - process_coding.consumed; | 701 carryover = nread - process_coding.consumed; |
700 if (carryover > 0) | 702 if (carryover > 0) |
701 { | 703 { |
702 /* As CARRYOVER should not be that large, we had | 704 /* As CARRYOVER should not be that large, we had |
703 better avoid overhead of bcopy. */ | 705 better avoid overhead of bcopy. */ |