+ {
+ if (process_coding.type == coding_type_no_conversion)
+ insert (bufptr, nread);
+ else
+ { /* We have to decode the input. */
+ int size = decoding_buffer_size (&process_coding, nread);
+ char *decoding_buf = (char *) xmalloc (size);
+
+ decode_coding (&process_coding, bufptr, decoding_buf,
+ nread, size);
+ if (display_on_the_fly
+ && saved_coding.type == coding_type_undecided
+ && process_coding.type != coding_type_undecided)
+ {
+ /* We have detected some coding system. But,
+ there's a possibility that the detection was
+ done by insufficient data. So, we give up
+ displaying on the fly. */
+ xfree (decoding_buf);
+ display_on_the_fly = 0;
+ process_coding = saved_coding;
+ carryover = nread;
+ continue;
+ }
+ if (process_coding.produced > 0)
+ insert (decoding_buf, process_coding.produced);
+ xfree (decoding_buf);
+ carryover = nread - process_coding.consumed;
+ if (carryover > 0)
+ {
+ /* As CARRYOVER should not be that large, we had
+ better avoid overhead of bcopy. */
+ char *p = bufptr + process_coding.consumed;
+ char *pend = p + carryover;
+ char *dst = bufptr;
+
+ while (p < pend) *dst++ = *p++;
+ }
+ }
+ }
+ if (process_coding.mode & CODING_MODE_LAST_BLOCK)
+ {
+ if (carryover > 0)
+ insert (bufptr, carryover);
+ break;
+ }