projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cca4450
)
Two bugfixes for deleting files (-p and message)
author
Rob Landley
<rob@landley.net>
Tue, 16 Dec 2008 07:48:27 +0000
(
01:48
-0600)
committer
Rob Landley
<rob@landley.net>
Tue, 16 Dec 2008 07:48:27 +0000
(
01:48
-0600)
toys/patch.c
patch
|
blob
|
history
diff --git
a/toys/patch.c
b/toys/patch.c
index
b1f8d41
..
6299653
100644
(file)
--- 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);