diff options
author | Rob Landley <rob@landley.net> | 2008-12-16 01:48:27 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2008-12-16 01:48:27 -0600 |
commit | 546ead6f4068611b7504baae1bf678d8b0b22942 (patch) | |
tree | b0ef8b4cedacd9f80cf1fb61b467040e332a5d76 | |
parent | cca44505f242e215c7b84cbad0a04d9fc64df899 (diff) | |
download | toybox-546ead6f4068611b7504baae1bf678d8b0b22942.tar.gz |
Two bugfixes for deleting files (-p and message)
-rw-r--r-- | toys/patch.c | 6 |
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); |