- extract_file:
- if (typeflag == GNUTYPE_SPARSE)
- {
- char *name;
- size_t name_length_bis;
-
- /* Kludge alert. NAME is assigned to header.name because
- during the extraction, the space that contains the header
- will get scribbled on, and the name will get munged, so any
- error messages that happen to contain the filename will look
- REAL interesting unless we do this. */
-
- name_length_bis = strlen (CURRENT_FILE_NAME) + 1;
- name = (char *) xmalloc (name_length_bis);
- memcpy (name, CURRENT_FILE_NAME, name_length_bis);
- size = current_stat.st_size;
- extract_sparse_file (fd, &size, current_stat.st_size, name);
- }
- else
- for (size = current_stat.st_size;
- size > 0;
- size -= written)
- {
- if (multi_volume_option)
- {
- assign_string (&save_name, current_file_name);
- save_totsize = current_stat.st_size;
- save_sizeleft = size;
- }
-
- /* Locate data, determine max length writeable, write it,
- block that we have used the data, then check if the write
- worked. */
-
- data_block = find_next_block ();
- if (data_block == NULL)
- {
- ERROR ((0, 0, _("Unexpected EOF on archive file")));
- break; /* FIXME: What happens, then? */
- }
-
- /* If the file is sparse, use the sparsearray that we created
- before to lseek into the new file the proper amount, and to
- see how many bytes we want to write at that position. */
-
-#if 0
- if (typeflag == GNUTYPE_SPARSE)
- {
- lseek (fd, sparsearray[sparse_ind].offset, 0);
- written = sparsearray[sparse_ind++].numbytes;
- }
- else