Remove */ characters from declare cursor statements before putting them into a
authorMichael Meskes <[email protected]>
Fri, 27 Nov 2009 16:07:22 +0000 (16:07 +0000)
committerMichael Meskes <[email protected]>
Fri, 27 Nov 2009 16:07:22 +0000 (16:07 +0000)
comment.

src/interfaces/ecpg/preproc/ecpg.addons

index a5e4a341e9280d15a36a21b92676a21692d3444c..323a2a1c878cf5b3066cb393529407e541eeeff2 100644 (file)
@@ -297,7 +297,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
    {
        struct cursor *ptr, *this;
        char *cursor_marker = $2[0] == ':' ? make_str("$0") : mm_strdup($2);
-       char *comment;
+       char *comment, *c1, *c2;
 
        for (ptr = cur; ptr != NULL; ptr = ptr->next)
        {
@@ -317,7 +317,14 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
        argsinsert = argsresult = NULL;
        cur = this;
 
-       comment = cat_str(3, make_str("/*"), mm_strdup(this->command), make_str("*/"));
+       c1 = mm_strdup(this->command);
+       if ((c2 = strstr(c1, "*/")) != NULL)
+       {
+           /* We put this text into a comment, so we better remove [*][/]. */
+           c2[0] = '.';
+           c2[1] = '.';
+       }
+       comment = cat_str(3, make_str("/*"), c1, make_str("*/"));
 
        if (INFORMIX_MODE)
        {