Commit dd158708 authored by Robert Haas's avatar Robert Haas

Correct a mistake in levenshtein_less_equal() multibyte character handling.

Spotted by Alexander Korotkov.

Along the way, remove a misleading comment line.
parent 57b80b4c
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* *
* Joe Conway <mail@joeconway.com> * Joe Conway <mail@joeconway.com>
* *
* contrib/fuzzystrmatch/fuzzystrmatch.c
* Copyright (c) 2001-2010, PostgreSQL Global Development Group * Copyright (c) 2001-2010, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED; * ALL RIGHTS RESERVED;
* *
...@@ -378,7 +377,7 @@ levenshtein_internal(text *s, text *t, ...@@ -378,7 +377,7 @@ levenshtein_internal(text *s, text *t,
prev[start_column] = max_d + 1; prev[start_column] = max_d + 1;
curr[start_column] = max_d + 1; curr[start_column] = max_d + 1;
if (start_column != 0) if (start_column != 0)
s_data += n != t_bytes + 1 ? pg_mblen(s_data) : 1; s_data += s_char_len != NULL ? s_char_len[i - 1] : 1;
start_column++; start_column++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment