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

Commit dd15870

Browse files
committed
Correct a mistake in levenshtein_less_equal() multibyte character handling.
Spotted by Alexander Korotkov. Along the way, remove a misleading comment line.
1 parent 57b80b4 commit dd15870

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contrib/fuzzystrmatch/levenshtein.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*
66
* Joe Conway <mail@joeconway.com>
77
*
8-
* contrib/fuzzystrmatch/fuzzystrmatch.c
98
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
109
* ALL RIGHTS RESERVED;
1110
*
@@ -378,7 +377,7 @@ levenshtein_internal(text *s, text *t,
378377
prev[start_column] = max_d + 1;
379378
curr[start_column] = max_d + 1;
380379
if (start_column != 0)
381-
s_data += n != t_bytes + 1 ? pg_mblen(s_data) : 1;
380+
s_data += s_char_len != NULL ? s_char_len[i - 1] : 1;
382381
start_column++;
383382
}
384383

0 commit comments

Comments
 (0)