summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-12-14 12:57:23 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-12-14 12:57:23 +0100
commit27195517c5bfdbc8821bfd3c957b6c35d6c13544 (patch)
tree1637434994d8d32ac4c13729ff756be80c279b10 /regcomp.c
parent271484c6837d9f5a36501dfb98494ae6eaae43aa (diff)
parent766e109fd638ef1eac33717b52e04a351da46483 (diff)
Merge tag 'upstream/5.9.6'
Upstream version 5.9.6
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 995e1d8..b93ca94 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2,7 +2,7 @@
regcomp.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -5575,11 +5575,44 @@ onig_init(void)
}
+static OnigEndCallListItemType* EndCallTop;
+
+extern void onig_add_end_call(void (*func)(void))
+{
+ OnigEndCallListItemType* item;
+
+ item = (OnigEndCallListItemType* )xmalloc(sizeof(*item));
+ if (item == 0) return ;
+
+ item->next = EndCallTop;
+ item->func = func;
+
+ EndCallTop = item;
+}
+
+static void
+exec_end_call_list(void)
+{
+ OnigEndCallListItemType* prev;
+ void (*func)(void);
+
+ while (EndCallTop != 0) {
+ func = EndCallTop->func;
+ (*func)();
+
+ prev = EndCallTop;
+ EndCallTop = EndCallTop->next;
+ xfree(prev);
+ }
+}
+
extern int
onig_end(void)
{
THREAD_ATOMIC_START;
+ exec_end_call_list();
+
#ifdef ONIG_DEBUG_STATISTICS
onig_print_statistics(stderr);
#endif