]> mj.ucw.cz Git - libucw.git/commitdiff
final changes to substr analyser... closes Bug 2385
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Tue, 18 Apr 2006 08:50:15 +0000 (10:50 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Tue, 18 Apr 2006 08:50:15 +0000 (10:50 +0200)
lib/kmp-new.h
lib/kmp-search.h

index 5966b8a5ecfbf6cb1cf9526c1deac603abb2efb6..15c15ae37fc43c38ec07e070db6597378c689ebe 100644 (file)
@@ -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)
index 0c572b65d43b3a9a3a84be08e6f848c100480ad6..3978c847ac6cb632dbe0707c1b21462a5f30c531 100644 (file)
@@ -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