summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-10-26 23:26:40 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-10-26 23:26:40 +0000
commit412fd50be59afe85f04125cee2d56a3f20e394ef (patch)
treeb907211dc684cbad156aaad403466150cdacdad9
parent6512ed3c11524aa7f67d4568a961af10bf840732 (diff)
downloadquilt-412fd50be59afe85f04125cee2d56a3f20e394ef.tar.gz
- Backup files were not reliably removed after restoring (this did not
matter with the .pc files).
-rw-r--r--lib/backup-files.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/backup-files.c b/lib/backup-files.c
index 36996c7..e4cd45a 100644
--- a/lib/backup-files.c
+++ b/lib/backup-files.c
@@ -202,12 +202,10 @@ process_file(char *file)
if (!opt_silent)
printf("Restoring %s\n", file);
unlink(file);
- if (link(backup, file) == -1) {
- if (link_or_copy(backup, file) != 0)
- return 1;
- unlink(backup);
- remove_parents(backup);
- }
+ if (link_or_copy(backup, file) != 0)
+ return 1;
+ unlink(backup);
+ remove_parents(backup);
}
return 0;
} else if (opt_what == what_remove) {