]> granicus.if.org Git - postgresql/commitdiff
Correct a mistake in levenshtein_less_equal() multibyte character handling.
authorRobert Haas <rhaas@postgresql.org>
Fri, 22 Oct 2010 19:27:39 +0000 (15:27 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 22 Oct 2010 19:27:39 +0000 (15:27 -0400)
Spotted by Alexander Korotkov.

Along the way, remove a misleading comment line.

contrib/fuzzystrmatch/levenshtein.c

index 178d0e4d754253f9f4cd0b47f2b804a006f4acd5..0d3ebe03dce782005113cc0d36713c570e21f99f 100644 (file)
@@ -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++;
                        }