/* List a tar archive, with support routines for reading a tar archive.
Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000,
- 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by John Gilmore, on 1985-08-26.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any later
+ Free Software Foundation; either version 3, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but
size_t size, written;
union block *next_long_name = 0;
union block *next_long_link = 0;
- size_t next_long_name_blocks;
- size_t next_long_link_blocks;
+ size_t next_long_name_blocks = 0;
+ size_t next_long_link_blocks = 0;
while (1)
{
static char *
decode_xform (char *file_name, void *data)
{
- xform_type type = *(xform_type*)data;
+ int type = *(int*)data;
switch (type)
{
- case xform_symlink:
+ case XFORM_SYMLINK:
/* FIXME: It is not quite clear how and to which extent are the symbolic
links subject to filename transformation. In the absence of another
solution, symbolic links are exempt from component stripping and
proper. */
return file_name;
- case xform_link:
+ case XFORM_LINK:
file_name = safer_name_suffix (file_name, true, absolute_names_option);
break;
- case xform_regfile:
+ case XFORM_REGFILE:
file_name = safer_name_suffix (file_name, false, absolute_names_option);
break;
}
}
bool
-transform_member_name (char **pinput, xform_type type)
+transform_member_name (char **pinput, int type)
{
- return transform_name_fp (pinput, decode_xform, &type);
+ return transform_name_fp (pinput, type, decode_xform, &type);
}
#define ISOCTAL(c) ((c)>='0'&&(c)<='7')
stat_info->is_dumpdir = true;
}
- transform_member_name (&stat_info->file_name, xform_regfile);
+ transform_member_name (&stat_info->file_name, XFORM_REGFILE);
+ switch (header->header.typeflag)
+ {
+ case SYMTYPE:
+ transform_member_name (&stat_info->link_name, XFORM_SYMLINK);
+ break;
+
+ case LNKTYPE:
+ transform_member_name (&stat_info->link_name, XFORM_LINK);
+ }
}
/* Convert buffer at WHERE0 of size DIGS from external format to