Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bb28e83

Browse files
author
Michael Meskes
committed
Remove */ characters from declare cursor statements before putting them into a
comment.
1 parent d7d5c68 commit bb28e83

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/interfaces/ecpg/preproc/ecpg.addons

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.10 2009/11/26 15:39:26 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.11 2009/11/27 16:07:22 meskes Exp $ */
22
ECPG: stmtClosePortalStmt block
33
{
44
if (INFORMIX_MODE)
@@ -297,7 +297,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
297297
{
298298
struct cursor *ptr, *this;
299299
char *cursor_marker = $2[0] == ':' ? make_str("$0") : mm_strdup($2);
300-
char *comment;
300+
char *comment, *c1, *c2;
301301

302302
for (ptr = cur; ptr != NULL; ptr = ptr->next)
303303
{
@@ -317,7 +317,14 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
317317
argsinsert = argsresult = NULL;
318318
cur = this;
319319

320-
comment = cat_str(3, make_str("/*"), mm_strdup(this->command), make_str("*/"));
320+
c1 = mm_strdup(this->command);
321+
if ((c2 = strstr(c1, "*/")) != NULL)
322+
{
323+
/* We put this text into a comment, so we better remove [*][/]. */
324+
c2[0] = '.';
325+
c2[1] = '.';
326+
}
327+
comment = cat_str(3, make_str("/*"), c1, make_str("*/"));
321328

322329
if (INFORMIX_MODE)
323330
{

0 commit comments

Comments
 (0)