]> granicus.if.org Git - nethack/commitdiff
follow-up 3
authornhmall <nhmall@nethack.org>
Thu, 30 Jun 2022 17:27:46 +0000 (13:27 -0400)
committernhmall <nhmall@nethack.org>
Thu, 30 Jun 2022 17:27:46 +0000 (13:27 -0400)
include/extern.h
sys/share/cppregex.cpp
sys/share/pmatchregex.c
sys/share/posixregex.c

index dcdffdbd51f001ab5b9fb02dd33bb73d01cd70b9..ae6dab2adae81a677c0c0a3d6c1d52464a160c7e 100644 (file)
@@ -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 ### */
 
index ca7d7978f5a66a979852873659a73daf9d52b57e..4da1528c66cd53446298ae8e5d0a765c1c32fecc 100644 (file)
@@ -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;
+    }
+}
+
index d04fdacc11bee45128a45d603eb2cbd247e16f7b..289fb51fb33f9185f07506b43d22d8aff36fed70 100644 (file)
@@ -65,3 +65,9 @@ regex_free(struct nhregex *re)
         free((genericptr_t) re);
     }
 }
+
+void
+regex_at_exit(void)
+{
+}
+
index 37f16ada99e359a9d69db506045a789c963e1f43..4000364babb6aa78090dca40d9bb09cd4f639e5c 100644 (file)
@@ -104,3 +104,9 @@ regex_free(struct nhregex *re)
     regfree(&re->re);
     free(re);
 }
+
+void
+regex_at_exit(void)
+{
+}
+