[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: --listed-incremental bug [patch]
From: |
Roland Illig |
Subject: |
Re: --listed-incremental bug [patch] |
Date: |
Fri, 4 Jan 2002 03:30:52 +0100 |
> I've found a bug in tar 1.13.19. I've also verified it with the
1.13.25
> alpha as follows:
> [src]$ ./tar --version
> tar (GNU tar) 1.13.25
> Copyright © 2001 Free Software Foundation, Inc.
> This program comes with NO WARRANTY, to the extent permitted by law.
> You may redistribute it under the terms of the GNU General Public
License;
> see the file named COPYING for details.
> Written by John Gilmore and Jay Fenlason.
> [src]$ cat > test
> This is a test file.
> [src]$
./tar --create --file=test.tar --listed-incremental=snapshot --verbose
test
> test
> [src]$ rm test.tar
> [src]$
./tar --create --file=test.tar --listed-incremental=snapshot --verbose
test
> test
> [src]$ ./tar --list --file=test.tar
> test
> During the second create command, I do not expect the file "test" to
be
> added to the tar file.
> Neologism
I think it's a bug, too. But I learned to handle gdb during the last
two hours, and here's the patch. It's nothing official, but it works
like you expected it.
Roland
diff -u -r tar-1.13.19-1.org/src/create.c tar-1.13.19-1/src/create.c
--- tar-1.13.19-1.org/src/create.c Wed Mar 28 02:31:06 2001
+++ tar-1.13.19-1/src/create.c Fri Jan 4 03:21:00 2002
@@ -938,12 +938,12 @@
/* See if we want only new files, and check if this one is too old
to
put in the archive. */
- if ((0 < top_level || !incremental_option)
+ if ((top_level >= 0 || incremental_option)
&& !S_ISDIR (current_stat.st_mode)
&& current_stat.st_mtime < newer_mtime_option
&& (!after_date_option || current_stat.st_ctime <
newer_ctime_option))
{
- if (0 < top_level)
+ if (top_level >= 0)
WARN ((0, 0, _("%s: file is unchanged; not dumped"),
quotearg_colon (p)));
/* FIXME: recheck this return. */