aboutsummaryrefslogtreecommitdiff
path: root/toys/patch.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/patch.c')
-rw-r--r--toys/patch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toys/patch.c b/toys/patch.c
index b1f8d413..62996538 100644
--- a/toys/patch.c
+++ b/toys/patch.c
@@ -270,9 +270,11 @@ void patch_main(void)
}
}
- if (del) xunlink(TT.oldname);
+ if (del) {
+ printf("removing %s\n", start);
+ xunlink(start);
// If we've got a file to open, do so.
- else if (!(toys.optflags & FLAG_PATHLEN) || i <= TT.prefix) {
+ } else if (!(toys.optflags & FLAG_PATHLEN) || i <= TT.prefix) {
// If the old file was null, we're creating a new one.
if (!strcmp(TT.oldname, "/dev/null")) {
printf("creating %s\n", start);