Minor logic fix for new levenshtein implementation.

Alexander Korotkov
This commit is contained in:
Tom Lane 2011-02-20 14:55:07 -05:00
parent 7c5d0ae707
commit 087bd179e6
2 changed files with 4 additions and 1 deletions

View file

@ -16,3 +16,6 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
# levenshtein.c is #included by fuzzystrmatch.c
fuzzystrmatch.o: fuzzystrmatch.c levenshtein.c

View file

@ -377,7 +377,7 @@ levenshtein_internal(text *s, text *t,
prev[start_column] = max_d + 1;
curr[start_column] = max_d + 1;
if (start_column != 0)
s_data += s_char_len != NULL ? s_char_len[i - 1] : 1;
s_data += (s_char_len != NULL) ? s_char_len[start_column - 1] : 1;
start_column++;
}