return r;
}
+void tarfile_skip_one_forward(struct TarInfo *ti,
+ struct fileinlist **oldnifd,
+ struct fileinlist *nifd) {
+ struct tarcontext *tc= (struct tarcontext*)ti->UserData;
+ size_t r;
+ char databuf[TARBLKSZ];
+
+ obstack_free(&tar_obs, nifd);
+ tc->newfilesp= oldnifd;
+ *oldnifd = 0;
+
+ /* We need to advance the tar file to the next object, so read the
+ * file data and set it to oblivion.
+ */
+ if ((ti->Type == NormalFile0) || (ti->Type == NormalFile1)) {
+ char fnamebuf[256];
+ fd_null_copy(tc->backendpipe, ti->Size, _("gobble replaced file `%.255s'"),quote_filename(fnamebuf,256,ti->Name));
+ r= ti->Size % TARBLKSZ;
+ if (r > 0) r= safe_read(tc->backendpipe,databuf,TARBLKSZ - r);
+ }
+}
+
int fnameidlu;
struct varbuf fnamevb;
struct varbuf fnametmpvb;
? nifd->namenode->divert->useinstead->name : "<none>");
if (filter_should_skip(ti) == 1) {
- struct filenamenode *fnn = findnamenode(ti->Name, 0);
- fnn->flags &= ~fnnf_new_inarchive;
- obstack_free(&tar_obs, nifd);
- tc->newfilesp= oldnifd;
- *oldnifd = 0;
-
- /* We need to advance the tar file to the next object, so read the
- * file data and set it to oblivion.
- */
- if ((ti->Type == NormalFile0) || (ti->Type == NormalFile1)) {
- char fnamebuf[256];
- fd_null_copy(tc->backendpipe, ti->Size, _("gobble replaced file `%.255s'"),quote_filename(fnamebuf,256,ti->Name));
- r= ti->Size % TARBLKSZ;
- if (r > 0) r= safe_read(tc->backendpipe,databuf,TARBLKSZ - r);
- }
- return 0;
+ struct filenamenode *fnn = findnamenode(ti->Name, 0);
+ fnn->flags &= ~fnnf_new_inarchive;
+ tarfile_skip_one_forward(ti, oldnifd, nifd);
+ return 0;
}
if (nifd->namenode->divert && nifd->namenode->divert->camefrom) {
if (existingdirectory) return 0;
if (keepexisting) {
- obstack_free(&tar_obs, nifd);
- tc->newfilesp= oldnifd;
- *oldnifd = 0;
-
- /* We need to advance the tar file to the next object, so read the
- * file data and set it to oblivion.
- */
- if ((ti->Type == NormalFile0) || (ti->Type == NormalFile1)) {
- char fnamebuf[256];
- fd_null_copy(tc->backendpipe, ti->Size, _("gobble replaced file `%.255s'"),quote_filename(fnamebuf,256,ti->Name));
- r= ti->Size % TARBLKSZ;
- if (r > 0) r= safe_read(tc->backendpipe,databuf,TARBLKSZ - r);
- }
-
+ tarfile_skip_one_forward(ti, oldnifd, nifd);
return 0;
}