From: nhmall Date: Thu, 30 Jun 2022 17:27:46 +0000 (-0400) Subject: follow-up 3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd57dfa5ffa3a408f07b24b24e2c758301fed143;p=nethack follow-up 3 --- diff --git a/include/extern.h b/include/extern.h index dcdffdbd5..ae6dab2ad 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1832,6 +1832,7 @@ extern boolean regex_compile(const char *, struct nhregex *); extern const char *regex_error_desc(struct nhregex *); extern boolean regex_match(const char *, struct nhregex *); extern void regex_free(struct nhregex *); +extern void regex_at_exit(void); /* ### consoletty.c ### */ diff --git a/sys/share/cppregex.cpp b/sys/share/cppregex.cpp index ca7d7978f..4da1528c6 100644 --- a/sys/share/cppregex.cpp +++ b/sys/share/cppregex.cpp @@ -63,3 +63,13 @@ extern "C" { delete re; } } + +void +regex_at_exit(void) +{ + if (cppregex_static_buffer != 0) { + free((genericptr_t) cppregex_static_buffer); + cppregex_static_buffer = (char *) 0; + } +} + diff --git a/sys/share/pmatchregex.c b/sys/share/pmatchregex.c index d04fdacc1..289fb51fb 100644 --- a/sys/share/pmatchregex.c +++ b/sys/share/pmatchregex.c @@ -65,3 +65,9 @@ regex_free(struct nhregex *re) free((genericptr_t) re); } } + +void +regex_at_exit(void) +{ +} + diff --git a/sys/share/posixregex.c b/sys/share/posixregex.c index 37f16ada9..4000364ba 100644 --- a/sys/share/posixregex.c +++ b/sys/share/posixregex.c @@ -104,3 +104,9 @@ regex_free(struct nhregex *re) regfree(&re->re); free(re); } + +void +regex_at_exit(void) +{ +} +