head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.05.19.18.38.11; author spz; state Exp; branches; next ; commitid 5x0jwzSnfR7nhsGG; desc @@ 1.1 log @deal with ctype functions faulting on invalid input on NetBSD 11 (by making invalid input less likely) While at it add LICENSE @ text @$NetBSD$ deal with ctype functions faulting on invalid input on NetBSD 11 --- regexp.c.orig 2026-05-16 21:28:59.660188282 +0000 +++ regexp.c @@@@ -33,7 +33,7 @@@@ #include #include #include -#include +#include "ctypeconv.h" #include "config.h" #include "global.h" #include "regexp.h" @@@@ -834,15 +834,15 @@@@ regmatch(char *prog) return (0); break; case W_START: - if (*reginput == '\0' || isspace(*reginput)) + if (*reginput == '\0' || ISSPACE(*reginput)) return (0); - if (reginput != regbol && !isspace(*(reginput - 1))) + if (reginput != regbol && !ISSPACE(*(reginput - 1))) return (0); break; case W_END: - if (*reginput != '\0' && !isspace(*reginput)) + if (*reginput != '\0' && !ISSPACE(*reginput)) return (0); - if (reginput == regbol || isspace(*(reginput - 1))) + if (reginput == regbol || ISSPACE(*(reginput - 1))) return (0); break; case ANY: @