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:
c65e89b
)
Fix reversed test: patch creates a file if /dev/null or dated the epoch _and_ first...
author
Rob Landley
<rob@landley.net>
Sat, 10 Nov 2012 20:34:01 +0000
(14:34 -0600)
committer
Rob Landley
<rob@landley.net>
Sat, 10 Nov 2012 20:34:01 +0000
(14:34 -0600)
toys/posix/patch.c
patch
|
blob
|
history
diff --git
a/toys/posix/patch.c
b/toys/posix/patch.c
index
fae908d
..
5af07a1
100644
(file)
--- a/
toys/posix/patch.c
+++ b/
toys/posix/patch.c
@@
-387,7
+387,7
@@
void patch_main(void)
// If we've got a file to open, do so.
} else if (!(toys.optflags & FLAG_p) || i <= TT.prefix) {
// If the old file was null, we're creating a new one.
- if (!strcmp(oldname, "/dev/null")
||
!oldsum) {
+ if (!strcmp(oldname, "/dev/null")
&&
!oldsum) {
printf("creating %s\n", name);
s = strrchr(name, '/');
if (s) {