From: Pavel Charvat Date: Tue, 18 Apr 2006 08:50:15 +0000 (+0200) Subject: final changes to substr analyser... closes Bug 2385 X-Git-Tag: holmes-import~650^2~7 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8da1372a2339f2c606a43e4bdcb48e4c34d84ebc;p=libucw.git final changes to substr analyser... closes Bug 2385 --- diff --git a/lib/kmp-new.h b/lib/kmp-new.h index 5966b8a5..15c15ae3 100644 --- a/lib/kmp-new.h +++ b/lib/kmp-new.h @@ -114,10 +114,9 @@ P(hash_eq) (struct P(hash_table) *t UNUSED, struct P(state) *f1, P(char_t) c1, s static inline void P(hash_init_key) (struct P(hash_table) *t UNUSED, struct P(state) *s, struct P(state) *f, P(char_t) c) { + memset(s, 0, sizeof(*s)); s->from = f; s->c = c; - s->len = 0; - s->back = NULL; s->next = f->back; /* the pointers hold the link-list of sons... change in build() */ f->back = s; } @@ -160,7 +159,7 @@ typedef byte *P(source_t); static inline int P(get_char) (struct P(context) *ctx, P(source_t) *src, P(char_t) *c) { - return KMP_GET_CHAR(*ctx, *src, *c); + return KMP_GET_CHAR(ctx, *src, *c); } #else # if defined(KMP_USE_UTF8) diff --git a/lib/kmp-search.h b/lib/kmp-search.h index 0c572b65..3978c847 100644 --- a/lib/kmp-search.h +++ b/lib/kmp-search.h @@ -24,7 +24,7 @@ * KMPS_GET_CHAR(ctx,src,s) * * KMPS_ADD_CONTROLS adds control characters to start and the end - * KMPS_MERGE_CONTROLS merges adjacent control characterss to a single one + * KMPS_MERGE_CONTROLS merges adjacent control characters to a single one * * KMPS_EXTRA_ARGS extra arguments to the search routine * KMPS_EXTRA_VAR extra user-defined structure in search structures