-/* $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 */
%{
Xconst: XCONST { $$ = make_name();};
Sconst: SCONST
{
- char *ret;
-
- $$ = ret = (char *)mm_alloc(strlen($1) + 4);
- if (strchr($1, '\\') != NULL)
- *ret++ = ESCAPE_STRING_SYNTAX;
- *ret++ = '\'';
- strcpy(ret, $1);
- ret += strlen($1);
- *ret++ = '\'';
- *ret++ = '\0';
+ $$ = (char *)mm_alloc(strlen($1) + 3);
+ $$[0]='\'';
+ strcpy($$+1, $1);
+ $$[strlen($1)+2]='\0';
+ $$[strlen($1)+1]='\'';
free($1);
}
;