[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] major problem with --listed-incremental silently failing
From: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] major problem with --listed-incremental silently failing |
Date: |
Tue, 13 Dec 2005 23:58:52 EET |
John R. Vanderpool <address@hidden> wrote:
> this patch seg faults, here is a trace of:
I should have paid more attention while converting it to 1.15.1! Here is
the correct version.
If you wish, you could also try the recent CVS snapshot, which already
implements similar changes:
ftp://download.gnu.org.ua/pub/alpha/tar/tar-1.15.2-20051213.tar.bz2
(.gz and .shar archives available from the same location)
Regards,
Sergey
diff -pur tar-1.15.1/src/common.h tar-1.15.1-n/src/common.h
--- tar-1.15.1/src/common.h 2004-12-21 16:31:58.000000000 +0200
+++ tar-1.15.1-n/src/common.h 2005-12-13 13:02:30.000000000 +0200
@@ -315,6 +315,7 @@ struct name
uintmax_t found_count; /* number of times a matching file has
been found */
int isdir;
+ int explicit; /* was explicitely given in the command line */
char firstch; /* first char is literally matched */
char regexp; /* this name is a regexp, not literal */
int change_dir; /* set with the -C option */
diff -pur tar-1.15.1/src/incremen.c tar-1.15.1-n/src/incremen.c
--- tar-1.15.1/src/incremen.c 2004-09-06 14:30:42.000000000 +0300
+++ tar-1.15.1-n/src/incremen.c 2005-12-13 13:03:26.000000000 +0200
@@ -174,6 +174,7 @@ scan_directory (struct obstack *stk, cha
if (S_ISDIR (stat_data.st_mode))
{
+ struct name *np;
bool nfs = NFS_FILE_STAT (stat_data);
if ((directory = find_directory (name_buffer)) != NULL)
@@ -216,7 +217,8 @@ scan_directory (struct obstack *stk, cha
: CHANGED_CHILDREN);
}
- if (one_file_system_option && device != stat_data.st_dev)
+ if (one_file_system_option && device != stat_data.st_dev
+ && !((np = name_scan (name_buffer)) && np->explicit)
directory->children = NO_CHILDREN;
else if (children == ALL_CHILDREN)
directory->children = ALL_CHILDREN;
diff -pur tar-1.15.1/src/names.c tar-1.15.1-n/src/names.c
--- tar-1.15.1/src/names.c 2004-09-06 14:30:54.000000000 +0300
+++ tar-1.15.1-n/src/names.c 2005-12-13 13:02:30.000000000 +0200
@@ -209,6 +209,7 @@ name_add (const char *name)
}
name_array[names++] = name;
}
+
/* Names from external name file. */
@@ -506,7 +507,8 @@ addname (char const *string, int change_
name->firstch = 1; /* assume first char is literal */
name->change_dir = change_dir;
name->dir_contents = 0;
-
+ name->explicit = 1;
+
if (string && is_pattern (string))
{
name->regexp = 1;
@@ -784,6 +786,8 @@ add_hierarchy_to_namelist (struct name *
string_length = strlen (string);
if (*string == 'D')
{
+ struct name *np;
+
if (allocated_length <= name_length + string_length)
{
do
@@ -797,8 +801,9 @@ add_hierarchy_to_namelist (struct name *
namebuf = xrealloc (namebuf, allocated_length + 1);
}
strcpy (namebuf + name_length, string + 1);
- add_hierarchy_to_namelist (addname (namebuf, change_dir),
- device);
+ np = addname (namebuf, change_dir);
+ np->explicit = 0;
+ add_hierarchy_to_namelist (np, device);
}
}