- xheader_store ("GNU.sparse.offset", file->stat_info, &i);
- xheader_store ("GNU.sparse.numbytes", file->stat_info, &i);
+ for (i = 0; i < file->stat_info->sparse_map_avail; i++)
+ {
+ xheader_store ("GNU.sparse.offset", file->stat_info, &i);
+ xheader_store ("GNU.sparse.numbytes", file->stat_info, &i);
+ }
+ }
+ else
+ {
+ xheader_string_begin ();
+ for (i = 0; i < file->stat_info->sparse_map_avail; i++)
+ {
+ if (i)
+ xheader_string_add (",");
+ xheader_string_add (umaxtostr (map[i].offset, nbuf));
+ xheader_string_add (",");
+ xheader_string_add (umaxtostr (map[i].numbytes, nbuf));
+ }
+ xheader_string_end ("GNU.sparse.map");