timeout.c's parse_signal() basically does what kill.c's signame_to_num()
does, except it expects "SIG" in string signals.
Borrow the isalpha() check from kill.c to get the same behaviour.
OK deraadt
-/* $OpenBSD: timeout.c,v 1.20 2022/01/12 22:51:44 tb Exp $ */
+/* $OpenBSD: timeout.c,v 1.21 2022/07/02 19:00:35 kn Exp $ */
/*
* Copyright (c) 2021 Job Snijders <job@openbsd.org>
#include <sys/time.h>
#include <sys/wait.h>
+#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <getopt.h>
long long sig;
const char *errstr;
- if (strncasecmp(str, "SIG", 3) == 0) {
+ if (isalpha((unsigned char)*str)) {
int i;
- str += 3;
+ if (strncasecmp(str, "SIG", 3) == 0)
+ str += 3;
for (i = 1; i < NSIG; i++) {
if (strcasecmp(str, sys_signame[i]) == 0)
return (i);