+ if (sum != recsum)
+ return 0;
+
+ /*
+ * Good record. Decode file size and return.
+ */
+ if (header->header.linkflag == LF_LINK)
+ hstat.st_size = 0; /* Links 0 size on tape */
+ else
+ hstat.st_size = from_oct(1+12, header->header.size);
+
+ head->header.arch_name[NAMSIZ-1] = '\0';
+ if (header->header.linkflag == LF_LONGNAME
+ || header->header.linkflag == LF_LONGLINK)
+ {
+ longp = ((header->header.linkflag == LF_LONGNAME)
+ ? &next_long_name
+ : &next_long_link);
+
+ if (*longp)
+ free (*longp);
+ bp = *longp = (char *) ck_malloc (hstat.st_size);
+
+ for (size = hstat.st_size;
+ size > 0;
+ size -= written)
+ {
+ data = findrec ()->charptr;
+ if (data == NULL)
+ {
+ msg ("Unexpected EOF on archive file");
+ break;
+ }
+ written = endofrecs () ->charptr - data;
+ if (written > size)
+ written = size;
+
+ bcopy (data, bp, written);
+ bp += written;
+ userec ((union record *) (data + written - 1));
+ }
+ goto recurse;
+ }
+ else
+ {
+ current_file_name = (next_long_name
+ ? next_long_name
+ : header->header.arch_name);
+ current_link_name = (next_long_link
+ ? next_long_link
+ : header->header.arch_linkname);
+ next_long_link = next_long_name = 0;
+ return 1;
+ }