Fix interaction between --listed-incremental and -C

* src/incremen.c (read_directory_file): Execute eventual -C dir
after opening the snapshot file.
(collect_and_sort_names): Remove call to chdir_do
* tests/incr05.at, tests/incr06.at: Use relative file names for
snapshot files.
This commit is contained in:
Sergey Poznyakoff
2009-08-13 16:45:49 +03:00
parent aeffa4f266
commit 006c1efbe8
4 changed files with 14 additions and 11 deletions
+7
View File
@@ -1324,6 +1324,13 @@ read_directory_file (void)
return;
}
/* Consume the first name from the name list and reset the
list afterwards. This is done to change to the new
directory, if the first name is a chdir request (-C dir),
which is necessary to recreate absolute file names. */
name_from_list ();
blank_name_list ();
if (0 < getline (&buf, &bufsize, listed_incremental_stream))
{
char *ebuf;
+1 -1
View File
@@ -903,7 +903,7 @@ collect_and_sort_names (void)
_("Only one -C option is allowed with "
"--listed-incremental")));
}
chdir_do (namelist->change_dir);
read_directory_file ();
}