- new_record[new_blocks] = *current_header;
- new_blocks++;
- blocks_needed--;
- blocks_to_keep
- = (current_stat.st_size + BLOCKSIZE - 1) / BLOCKSIZE;
- set_next_block_after (current_header);
- if (blocks_needed == 0)
- write_record (1);
+ /* Found another header. */
+
+ if ((name = name_scan (current_stat_info.file_name)) != NULL)
+ {
+ name->found_count++;
+ if (ISFOUND(name))
+ {
+ flush_file:
+ set_next_block_after (current_header);
+ blocks_to_skip = (current_stat_info.stat.st_size
+ + BLOCKSIZE - 1) / BLOCKSIZE;
+
+ while (record_end - current_block <= blocks_to_skip)
+ {
+ blocks_to_skip -= (record_end - current_block);
+ flush_archive ();
+ }
+ current_block += blocks_to_skip;
+ blocks_to_skip = 0;
+ continue;
+ }
+ }
+ /* Copy header. */
+
+ if (current_stat_info.xhdr.size)
+ {
+ write_recent_bytes (current_stat_info.xhdr.buffer,
+ current_stat_info.xhdr.size);
+ }
+ else
+ {
+ write_recent_blocks (recent_long_name, recent_long_name_blocks);
+ write_recent_blocks (recent_long_link, recent_long_link_blocks);
+ }
+ new_record[new_blocks] = *current_header;
+ new_blocks++;
+ blocks_to_keep
+ = (current_stat_info.stat.st_size + BLOCKSIZE - 1) / BLOCKSIZE;
+ set_next_block_after (current_header);
+ if (new_blocks == blocking_factor)
+ write_record (1);