aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-10-22 15:27:39 -0400
committerRobert Haas <rhaas@postgresql.org>2010-10-22 15:27:39 -0400
commitdd1587089c3dadd4bc1c85e8e75edf3a24686934 (patch)
treec9389fc89dc1b4984558e8d43e69c53e3f433413
parent57b80b4c466f224b6623e38081cea6e6d2fe0744 (diff)
downloadpostgresql-dd1587089c3dadd4bc1c85e8e75edf3a24686934.tar.gz
postgresql-dd1587089c3dadd4bc1c85e8e75edf3a24686934.zip
Correct a mistake in levenshtein_less_equal() multibyte character handling.
Spotted by Alexander Korotkov. Along the way, remove a misleading comment line.
-rw-r--r--contrib/fuzzystrmatch/levenshtein.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/fuzzystrmatch/levenshtein.c b/contrib/fuzzystrmatch/levenshtein.c
index 178d0e4d754..0d3ebe03dce 100644
--- a/contrib/fuzzystrmatch/levenshtein.c
+++ b/contrib/fuzzystrmatch/levenshtein.c
@@ -5,7 +5,6 @@
*
* Joe Conway <mail@joeconway.com>
*
- * contrib/fuzzystrmatch/fuzzystrmatch.c
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@@ -378,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 += n != t_bytes + 1 ? pg_mblen(s_data) : 1;
+ s_data += s_char_len != NULL ? s_char_len[i - 1] : 1;
start_column++;
}