+ mv_end ();
+
+ stat_info->dumpdir = archive_dir;
+ stat_info->skipped = true; /* For skip_member() and friends
+ to work correctly */
+}
+
+/* Return T if STAT_INFO represents a dumpdir archive member.
+ Note: can invalidate current_header. It happens if flush_archive()
+ gets called within get_gnu_dumpdir() */
+bool
+is_dumpdir (struct tar_stat_info *stat_info)
+{
+ if (stat_info->is_dumpdir && !stat_info->dumpdir)
+ get_gnu_dumpdir (stat_info);
+ return stat_info->is_dumpdir;
+}
+
+/* Examine the directories under directory_name and delete any
+ files that were not there at the time of the back-up. */
+void
+purge_directory (char const *directory_name)
+{
+ char *current_dir;
+ char *cur, *arc;
+
+ if (!is_dumpdir (¤t_stat_info))
+ {
+ skip_member ();
+ return;
+ }
+
+ current_dir = savedir (directory_name);
+
+ if (!current_dir)
+ {
+ /* The directory doesn't exist now. It'll be created. In any
+ case, we don't have to delete any files out of it. */
+
+ skip_member ();
+ return;
+ }
+