Back out incorrect use of E'' escape addition.

This commit is contained in:
Bruce Momjian 2005-08-22 20:25:03 +00:00
parent 83357da684
commit 9bddb5c8c7
1 changed files with 6 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.308 2005/07/02 17:01:53 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.309 2005/08/22 20:25:03 momjian Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
@ -4216,16 +4216,11 @@ Bconst: BCONST { $$ = make_name();};
Xconst: XCONST { $$ = make_name();}; Xconst: XCONST { $$ = make_name();};
Sconst: SCONST Sconst: SCONST
{ {
char *ret; $$ = (char *)mm_alloc(strlen($1) + 3);
$$[0]='\'';
$$ = ret = (char *)mm_alloc(strlen($1) + 4); strcpy($$+1, $1);
if (strchr($1, '\\') != NULL) $$[strlen($1)+2]='\0';
*ret++ = ESCAPE_STRING_SYNTAX; $$[strlen($1)+1]='\'';
*ret++ = '\'';
strcpy(ret, $1);
ret += strlen($1);
*ret++ = '\'';
*ret++ = '\0';
free($1); free($1);
} }
; ;