aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-02-20 14:55:07 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-02-20 14:55:07 -0500
commit087bd179e63f199105dabc8be0c8aebd087a178e (patch)
tree119eaf427a23d18045b11d531c003469db41c2d4
parent7c5d0ae7078456bfeedb2103c45b9a32285c2631 (diff)
downloadpostgresql-087bd179e63f199105dabc8be0c8aebd087a178e.tar.gz
postgresql-087bd179e63f199105dabc8be0c8aebd087a178e.zip
Minor logic fix for new levenshtein implementation.
Alexander Korotkov
-rw-r--r--contrib/fuzzystrmatch/Makefile3
-rw-r--r--contrib/fuzzystrmatch/levenshtein.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/contrib/fuzzystrmatch/Makefile b/contrib/fuzzystrmatch/Makefile
index 74728a30b56..834b679b102 100644
--- a/contrib/fuzzystrmatch/Makefile
+++ b/contrib/fuzzystrmatch/Makefile
@@ -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
diff --git a/contrib/fuzzystrmatch/levenshtein.c b/contrib/fuzzystrmatch/levenshtein.c
index 30a517f5f99..3d85d4175fb 100644
--- a/contrib/fuzzystrmatch/levenshtein.c
+++ b/contrib/fuzzystrmatch/levenshtein.c
@@ -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++;
}