X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fwildmatch.c;h=be98a995ded83ec068939603a3691a658d749b10;hb=0c53af3db5fdca461f49998194ecbfd8f55b7a8a;hp=ba2592f3313b9623baeb0aa74d41d3481ee648c1;hpb=1571781022499a9d0c32d249f89945d034d1cbff;p=libucw.git diff --git a/lib/wildmatch.c b/lib/wildmatch.c index ba2592f3..be98a995 100644 --- a/lib/wildmatch.c +++ b/lib/wildmatch.c @@ -4,6 +4,9 @@ * Traditional NFA -> DFA method with on-the-fly DFA construction. * * (c) 1999 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #include "lib/lib.h" @@ -70,7 +73,7 @@ wp_new_state(struct wildpatt *w, u32 set) if (d = w->free_states) w->free_states = d->next; else - d = pool_alloc(w->pool, sizeof(*d)); + d = mp_alloc(w->pool, sizeof(*d)); w->hash[h] = d; bzero(d, sizeof(*d)); d->nfa_set = set; @@ -103,8 +106,7 @@ wp_compile(byte *p, struct mempool *pool) if (strlen(p) >= MAX_STATES) /* Too long */ return NULL; - w = pool_alloc(pool, sizeof(*w)); - bzero(w, sizeof(*w)); + w = mp_alloc_zero(pool, sizeof(*w)); w->pool = pool; for(i=1; *p; p++) { @@ -209,7 +211,7 @@ int main(int argc, char **argv) char buf[1024]; if (argc != 2) return 1; - w = wp_compile(argv[1], new_pool(65536)); + w = wp_compile(argv[1], mp_new(65536)); if (!w) { puts("Compile error");