aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/fuzzystrmatch/README.fuzzystrmatch5
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch.c11
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch.h5
3 files changed, 14 insertions, 7 deletions
diff --git a/contrib/fuzzystrmatch/README.fuzzystrmatch b/contrib/fuzzystrmatch/README.fuzzystrmatch
index 8d310b4ade4..9cd80f81b72 100644
--- a/contrib/fuzzystrmatch/README.fuzzystrmatch
+++ b/contrib/fuzzystrmatch/README.fuzzystrmatch
@@ -3,7 +3,10 @@
*
* Functions for "fuzzy" comparison of strings
*
- * Copyright (c) Joseph Conway <joseph.conway@home.com>, 2001;
+ * Joe Conway <mail@joeconway.com>
+ *
+ * Copyright (c) 2001, 2002, 2003 by PostgreSQL Global Development Group
+ * ALL RIGHTS RESERVED;
*
* levenshtein()
* -------------
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.c b/contrib/fuzzystrmatch/fuzzystrmatch.c
index 0358fb2b66b..67e70cfc7e2 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.c
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.c
@@ -3,7 +3,10 @@
*
* Functions for "fuzzy" comparison of strings
*
- * Copyright (c) Joseph Conway <joseph.conway@home.com>, 2001;
+ * Joe Conway <mail@joeconway.com>
+ *
+ * Copyright (c) 2001, 2002, 2003 by PostgreSQL Global Development Group
+ * ALL RIGHTS RESERVED;
*
* levenshtein()
* -------------
@@ -221,9 +224,6 @@ metaphone(PG_FUNCTION_ARGS)
if (!(reqlen > 0))
elog(ERROR, "metaphone: Requested Metaphone output length must be > 0");
- metaph = palloc(reqlen);
- memset(metaph, '\0', reqlen);
-
retval = _metaphone(str_i, reqlen, &metaph);
if (retval == META_SUCCESS)
{
@@ -629,7 +629,8 @@ _metaphone(
/* KS */
case 'X':
Phonize('K');
- Phonize('S');
+ if (max_phonemes == 0 || Phone_Len < max_phonemes)
+ Phonize('S');
break;
/* Y if followed by a vowel */
case 'Y':
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.h b/contrib/fuzzystrmatch/fuzzystrmatch.h
index c8dbddeb076..079e520b8e5 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.h
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.h
@@ -3,7 +3,10 @@
*
* Functions for "fuzzy" comparison of strings
*
- * Copyright (c) Joseph Conway <joseph.conway@home.com>, 2001;
+ * Joe Conway <mail@joeconway.com>
+ *
+ * Copyright (c) 2001, 2002, 2003 by PostgreSQL Global Development Group
+ * ALL RIGHTS RESERVED;
*
* levenshtein()
* -------------