(encode_coding_raw_text): Set coding->produced_char for all branches.

Compute it differently.
This commit is contained in:
Stefan Monnier 2008-05-27 15:49:49 +00:00
parent 5dd5d9eb1a
commit 01d45367b2
2 changed files with 4 additions and 4 deletions

View file

@ -4818,7 +4818,6 @@ encode_coding_raw_text (coding)
int *charbuf_end = coding->charbuf + coding->charbuf_used;
unsigned char *dst = coding->destination + coding->produced;
unsigned char *dst_end = coding->destination + coding->dst_bytes;
int produced_chars = 0;
int c;
if (multibytep)
@ -4873,7 +4872,6 @@ encode_coding_raw_text (coding)
*dst++ = CHAR_TO_BYTE8 (c);
else
CHAR_STRING_ADVANCE (c, dst);
produced_chars++;
}
}
else
@ -4881,11 +4879,10 @@ encode_coding_raw_text (coding)
ASSURE_DESTINATION (charbuf_end - charbuf);
while (charbuf < charbuf_end && dst < dst_end)
*dst++ = *charbuf++;
produced_chars = dst - (coding->destination + coding->dst_bytes);
}
}
record_conversion_result (coding, CODING_RESULT_SUCCESS);
coding->produced_char += produced_chars;
coding->produced_char += charbuf - coding->charbuf;
coding->produced = dst - coding->destination;
return 0;
}