Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 087bd17

Browse files
committed
Minor logic fix for new levenshtein implementation.
Alexander Korotkov
1 parent 7c5d0ae commit 087bd17

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

contrib/fuzzystrmatch/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ top_builddir = ../..
1616
include $(top_builddir)/src/Makefile.global
1717
include $(top_srcdir)/contrib/contrib-global.mk
1818
endif
19+
20+
# levenshtein.c is #included by fuzzystrmatch.c
21+
fuzzystrmatch.o: fuzzystrmatch.c levenshtein.c

contrib/fuzzystrmatch/levenshtein.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ levenshtein_internal(text *s, text *t,
377377
prev[start_column] = max_d + 1;
378378
curr[start_column] = max_d + 1;
379379
if (start_column != 0)
380-
s_data += s_char_len != NULL ? s_char_len[i - 1] : 1;
380+
s_data += (s_char_len != NULL) ? s_char_len[start_column - 1] : 1;
381381
start_column++;
382382
}
383383

0 commit comments

Comments
 (0)