diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-18 08:22:21 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-18 08:22:21 +0000 |
commit | 17ef61b2fd942bf45c98f7ec4159dc06ebacf9dd (patch) | |
tree | 11f34f0c224c783f3492e28e824b2a7f2e444e02 /src/create.c | |
parent | f32828d577a8644d43e2eccc4bec200137df0f88 (diff) | |
download | tar-17ef61b2fd942bf45c98f7ec4159dc06ebacf9dd.tar.gz |
(dump_file0): Original ctime cannot be used as a directory change indicator if --remove-files is given.
Diffstat (limited to 'src/create.c')
-rw-r--r-- | src/create.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/create.c b/src/create.c index 4ff30542..eaaf8a75 100644 --- a/src/create.c +++ b/src/create.c @@ -1195,7 +1195,6 @@ dump_dir0 (char *directory, /* Now output all the files in the directory. */ /* FIXME: Should speed this up by cd-ing into the dir. */ - for (entry = directory; (entry_len = strlen (entry)) != 0; entry += entry_len + 1) { @@ -1646,7 +1645,10 @@ dump_file0 (struct tar_stat_info *st, const char *p, if (ok) { - if (timespec_cmp (get_stat_ctime (&final_stat), original_ctime) != 0 + if ((timespec_cmp (get_stat_ctime (&final_stat), original_ctime) != 0 + /* Original ctime will change if the file is a directory and + --remove-files is given */ + && !(remove_files_option && is_dir)) || original_size < final_stat.st_size) { WARN ((0, 0, _("%s: file changed as we read it"), |