diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2007-11-16 17:03:15 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2007-11-16 17:03:15 +0000 |
commit | 7b855679623eb4096390b827aaa24ba3b1d2bd27 (patch) | |
tree | 5378edd29b6171be8b0a114de2565c3c208ec690 /contrib/tsearch2/tsvector.c | |
parent | bf519d64f404776c163f3f9446ddd05bc10b2fbf (diff) |
Backpatch: Fix tsvector_out() and tsquery_out() to escape backslesh, add test of that.
Patch by Bruce Momjian <bruce@momjian.us>
Diffstat (limited to 'contrib/tsearch2/tsvector.c')
-rw-r--r-- | contrib/tsearch2/tsvector.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/tsearch2/tsvector.c b/contrib/tsearch2/tsvector.c index 059a247f186..ac8923d8dac 100644 --- a/contrib/tsearch2/tsvector.c +++ b/contrib/tsearch2/tsvector.c @@ -550,6 +550,14 @@ tsvector_out(PG_FUNCTION_ARGS) curout = outbuf + pos; *curout++ = '\''; } + else if (t_iseq(curin, '\\')) + { + int4 pos = curout - outbuf; + + outbuf = (char *) repalloc((void *) outbuf, ++lenbuf); + curout = outbuf + pos; + *curout++ = '\\'; + } while (len--) *curout++ = *curin++; } |