+ if (append_mode) {
+ OFF_T j = 0;
+ for (j = CHUNK_SIZE; j < s->flength; j += CHUNK_SIZE) {
+ sum_update(map_ptr(buf, last_match, CHUNK_SIZE),
+ CHUNK_SIZE);
+ last_match = j;
+ }
+ if (last_match < s->flength) {
+ int32 len = s->flength - last_match;
+ sum_update(map_ptr(buf, last_match, len), len);
+ last_match = s->flength;
+ }
+ s->count = 0;
+ }
+
+ if (len > 0 && s->count > 0) {