aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/patch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/patch.c b/toys/posix/patch.c
index fae908db..5af07a14 100644
--- 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) {