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 $ */
22ECPG: stmtClosePortalStmt block
33{
44if (INFORMIX_MODE)
@@ -297,7 +297,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
297297{
298298struct cursor *ptr, *this;
299299char *cursor_marker = $2[0] == ':' ? make_str("$0") : mm_strdup($2);
300- char *comment;
300+ char *comment, *c1, *c2 ;
301301
302302for (ptr = cur; ptr != NULL; ptr = ptr->next)
303303{
@@ -317,7 +317,14 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
317317argsinsert = argsresult = NULL;
318318cur = 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
322329if (INFORMIX_MODE)
323330{