aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 f12f9183..8c93fdfd 100644
--- a/toys/posix/patch.c
+++ b/toys/posix/patch.c
@@ -327,7 +327,7 @@ void patch_main(void)
finish_oldfile();
// Trim date from end of filename (if any). We don't care.
- for (s = patchline+4; *s && *s!='\t'; s++)
+ for (s = patchline+4; *s && (*s!='\t' || !isdigit(s[1])); s++)
if (*s=='\\' && s[1]) s++;
i = atoi(s);
if (i>1900 && i<=1970) *name = xstrdup("/dev/null");