Skip to content

Commit 9bddb5c

Browse files
committed
Back out incorrect use of E'' escape addition.
1 parent 83357da commit 9bddb5c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.308 2005/07/02 17:01:53 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.309 2005/08/22 20:25:03 momjian Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -4216,16 +4216,11 @@ Bconst: BCONST { $$ = make_name();};
42164216
Xconst: XCONST { $$ = make_name();};
42174217
Sconst: SCONST
42184218
{
4219-
char *ret;
4220-
4221-
$$ = ret = (char *)mm_alloc(strlen($1) + 4);
4222-
if (strchr($1, '\\') != NULL)
4223-
*ret++ = ESCAPE_STRING_SYNTAX;
4224-
*ret++ = '\'';
4225-
strcpy(ret, $1);
4226-
ret += strlen($1);
4227-
*ret++ = '\'';
4228-
*ret++ = '\0';
4219+
$$ = (char *)mm_alloc(strlen($1) + 3);
4220+
$$[0]='\'';
4221+
strcpy($$+1, $1);
4222+
$$[strlen($1)+2]='\0';
4223+
$$[strlen($1)+1]='\'';
42294224
free($1);
42304225
}
42314226
;

0 commit comments

Comments
 (0)