diff options
| author | Karoly Lorentey | 2005-06-15 12:57:51 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-06-15 12:57:51 +0000 |
| commit | ef85512e51f043d73788f00a2aed13cccde0682c (patch) | |
| tree | fc1fa1378533250f260ef8eaa9a84ae882d9df84 /src/callproc.c | |
| parent | 8736257554f49445f7b4402ac7a9436b38ce6452 (diff) | |
| parent | ef88a9999004e6c26148c8d280d6a41f623d7249 (diff) | |
| download | emacs-ef85512e51f043d73788f00a2aed13cccde0682c.tar.gz emacs-ef85512e51f043d73788f00a2aed13cccde0682c.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364
Remove "-face" suffix from widget faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Remove "-face" suffix from custom faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366
Remove "-face" suffix from change-log faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367
Remove "-face" suffix from compilation faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368
Remove "-face" suffix from diff-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369
lisp/longlines.el (longlines-visible-face): Face removed
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370
Remove "-face" suffix from woman faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371
Remove "-face" suffix from whitespace-highlight face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373
Remove "-face" suffix from show-paren faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Remove "-face" suffix from log-view faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375
Remove "-face" suffix from smerge faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376
Remove "-face" suffix from show-tabs faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377
Remove "-face" suffix from highlight-changes faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378
Remove "-face" suffix from and downcase info faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Remove "-face" suffix from pcvs faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380
Update uses of renamed pcvs faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381
Tweak ChangeLog
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383
Remove "-face" suffix from strokes-char face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384
Remove "-face" suffix from compare-windows face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385
Remove "-face" suffix from calendar faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386
Remove "-face" suffix from diary-button face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387
Remove "-face" suffix from testcover faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388
Remove "-face" suffix from viper faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389
Remove "-face" suffix from org faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390
Remove "-face" suffix from sgml-namespace face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391
Remove "-face" suffix from table-cell face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392
Remove "-face" suffix from tex-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393
Remove "-face" suffix from texinfo-heading face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394
Remove "-face" suffix from flyspell faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397
Remove "-face" suffix from gomoku faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398
Remove "-face" suffix from mpuz faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408
Remove "-face" suffix from Buffer-menu-buffer face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409
Remove "-face" suffix from antlr-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Remove "-face" suffix from ebrowse faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412
Remove "-face" suffix from flymake faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413
Remove "-face" suffix from idlwave faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414
Remove "-face" suffix from sh-script faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415
Remove "-face" suffix from vhdl-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417
Remove "-face" suffix from which-func face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418
Remove "-face" suffix from cperl-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419
Remove "-face" suffix from ld-script faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420
Fix cperl-mode font-lock problem
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421
Tweak which-func face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/callproc.c b/src/callproc.c index 6027ccdda9f..fe198b0770a 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -218,9 +218,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 218 | int fd[2]; | 218 | int fd[2]; |
| 219 | int filefd; | 219 | int filefd; |
| 220 | register int pid; | 220 | register int pid; |
| 221 | char buf[16384]; | 221 | #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) |
| 222 | char *bufptr = buf; | 222 | #define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN) |
| 223 | int bufsize = sizeof buf; | 223 | char buf[CALLPROC_BUFFER_SIZE_MAX]; |
| 224 | int bufsize = CALLPROC_BUFFER_SIZE_MIN; | ||
| 224 | int count = SPECPDL_INDEX (); | 225 | int count = SPECPDL_INDEX (); |
| 225 | 226 | ||
| 226 | register const unsigned char **new_argv | 227 | register const unsigned char **new_argv |
| @@ -765,7 +766,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 765 | nread = carryover; | 766 | nread = carryover; |
| 766 | while (nread < bufsize - 1024) | 767 | while (nread < bufsize - 1024) |
| 767 | { | 768 | { |
| 768 | int this_read = emacs_read (fd[0], bufptr + nread, | 769 | int this_read = emacs_read (fd[0], buf + nread, |
| 769 | bufsize - nread); | 770 | bufsize - nread); |
| 770 | 771 | ||
| 771 | if (this_read < 0) | 772 | if (this_read < 0) |
| @@ -790,7 +791,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 790 | if (!NILP (buffer)) | 791 | if (!NILP (buffer)) |
| 791 | { | 792 | { |
| 792 | if (! CODING_MAY_REQUIRE_DECODING (&process_coding)) | 793 | if (! CODING_MAY_REQUIRE_DECODING (&process_coding)) |
| 793 | insert_1_both (bufptr, nread, nread, 0, 1, 0); | 794 | insert_1_both (buf, nread, nread, 0, 1, 0); |
| 794 | else | 795 | else |
| 795 | { /* We have to decode the input. */ | 796 | { /* We have to decode the input. */ |
| 796 | int size; | 797 | int size; |
| @@ -807,7 +808,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 807 | requires text-encoding detection. */ | 808 | requires text-encoding detection. */ |
| 808 | if (process_coding.type == coding_type_undecided) | 809 | if (process_coding.type == coding_type_undecided) |
| 809 | { | 810 | { |
| 810 | detect_coding (&process_coding, bufptr, nread); | 811 | detect_coding (&process_coding, buf, nread); |
| 811 | if (process_coding.composing != COMPOSITION_DISABLED) | 812 | if (process_coding.composing != COMPOSITION_DISABLED) |
| 812 | /* We have not yet allocated the composition | 813 | /* We have not yet allocated the composition |
| 813 | data because the coding type was undecided. */ | 814 | data because the coding type was undecided. */ |
| @@ -816,7 +817,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 816 | if (process_coding.cmp_data) | 817 | if (process_coding.cmp_data) |
| 817 | process_coding.cmp_data->char_offset = PT; | 818 | process_coding.cmp_data->char_offset = PT; |
| 818 | 819 | ||
| 819 | decode_coding (&process_coding, bufptr, decoding_buf, | 820 | decode_coding (&process_coding, buf, decoding_buf, |
| 820 | nread, size); | 821 | nread, size); |
| 821 | 822 | ||
| 822 | if (display_on_the_fly | 823 | if (display_on_the_fly |
| @@ -905,7 +906,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 905 | if (carryover > 0) | 906 | if (carryover > 0) |
| 906 | /* As CARRYOVER should not be that large, we had | 907 | /* As CARRYOVER should not be that large, we had |
| 907 | better avoid overhead of bcopy. */ | 908 | better avoid overhead of bcopy. */ |
| 908 | BCOPY_SHORT (bufptr + process_coding.consumed, bufptr, | 909 | BCOPY_SHORT (buf + process_coding.consumed, buf, |
| 909 | carryover); | 910 | carryover); |
| 910 | if (process_coding.result == CODING_FINISH_INSUFFICIENT_CMP) | 911 | if (process_coding.result == CODING_FINISH_INSUFFICIENT_CMP) |
| 911 | { | 912 | { |
| @@ -922,17 +923,13 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 922 | if (process_coding.mode & CODING_MODE_LAST_BLOCK) | 923 | if (process_coding.mode & CODING_MODE_LAST_BLOCK) |
| 923 | break; | 924 | break; |
| 924 | 925 | ||
| 926 | #if (CALLPROC_BUFFER_SIZE_MIN != CALLPROC_BUFFER_SIZE_MAX) | ||
| 925 | /* Make the buffer bigger as we continue to read more data, | 927 | /* Make the buffer bigger as we continue to read more data, |
| 926 | but not past 64k. */ | 928 | but not past CALLPROC_BUFFER_SIZE_MAX. */ |
| 927 | if (bufsize < 64 * 1024 && total_read > 32 * bufsize) | 929 | if (bufsize < CALLPROC_BUFFER_SIZE_MAX && total_read > 32 * bufsize) |
| 928 | { | 930 | if ((bufsize *= 2) > CALLPROC_BUFFER_SIZE_MAX) |
| 929 | char *tempptr; | 931 | bufsize = CALLPROC_BUFFER_SIZE_MAX; |
| 930 | bufsize *= 2; | 932 | #endif |
| 931 | |||
| 932 | tempptr = (char *) alloca (bufsize); | ||
| 933 | bcopy (bufptr, tempptr, bufsize / 2); | ||
| 934 | bufptr = tempptr; | ||
| 935 | } | ||
| 936 | 933 | ||
| 937 | if (display_p) | 934 | if (display_p) |
| 938 | { | 935 | { |