summaryrefslogtreecommitdiff
path: root/contrib/tsearch2/dict_syn.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tsearch2/dict_syn.c')
-rw-r--r--contrib/tsearch2/dict_syn.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/tsearch2/dict_syn.c b/contrib/tsearch2/dict_syn.c
index 046a594903..6e3ed86434 100644
--- a/contrib/tsearch2/dict_syn.c
+++ b/contrib/tsearch2/dict_syn.c
@@ -162,7 +162,7 @@ syn_lexize(PG_FUNCTION_ARGS)
char *in = (char *) PG_GETARG_POINTER(1);
Syn key,
*found;
- char **res = NULL;
+ TSLexeme *res = NULL;
if (!PG_GETARG_INT32(2))
PG_RETURN_POINTER(NULL);
@@ -176,10 +176,9 @@ syn_lexize(PG_FUNCTION_ARGS)
if (!found)
PG_RETURN_POINTER(NULL);
- res = palloc(sizeof(char *) * 2);
-
- res[0] = pstrdup(found->out);
- res[1] = NULL;
+ res = palloc(sizeof(TSLexeme) * 2);
+ memset(res,0,sizeof(TSLexeme) * 2);
+ res[0].lexeme = pstrdup(found->out);
PG_RETURN_POINTER(res);
}