+ all special token parameters may now have their string in braces like <?bla(:(...
authorWilfried Göesgens <willi@citadel.org>
Sun, 11 Jan 2009 22:44:15 +0000 (22:44 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 11 Jan 2009 22:44:15 +0000 (22:44 +0000)
webcit/subst.c

index 5259828cf0bb35b5c93e43e8c8114e5e2eee219b..2e35216f700bb3673bedbe85878c3486c21efd8e 100644 (file)
@@ -768,7 +768,7 @@ TemplateParam *GetNextParameter(StrBuf *Buf, const char **pCh, const char *pe, W
        const char *pchs, *pche;
        TemplateParam *Parm = (TemplateParam *) malloc(sizeof(TemplateParam));
        char quote = '\0';
-       
+       int ParamBrace = 0;
 
        Parm->Type = TYPE_STR;
 
@@ -781,20 +781,34 @@ TemplateParam *GetNextParameter(StrBuf *Buf, const char **pCh, const char *pe, W
        if (*pch == ':') {
                Parm->Type = TYPE_PREFSTR;
                pch ++;
+               if (*pch == '(') {
+                       pch ++;
+                       ParamBrace = 1;
+               }
        }
        else if (*pch == ';') {
                Parm->Type = TYPE_PREFINT;
                pch ++;
+               if (*pch == '(') {
+                       pch ++;
+                       ParamBrace = 1;
+               }
        }
        else if (*pch == '_') {
                Parm->Type = TYPE_GETTEXT;
                pch ++;
-               if (*pch == '(')
+               if (*pch == '(') {
                        pch ++;
+                       ParamBrace = 1;
+               }
        }
        else if (*pch == 'B') {
                Parm->Type = TYPE_BSTR;
                pch ++;
+               if (*pch == '(') {
+                       pch ++;
+                       ParamBrace = 1;
+               }
        }
 
 
@@ -832,7 +846,7 @@ TemplateParam *GetNextParameter(StrBuf *Buf, const char **pCh, const char *pe, W
                        Parm->Start = pchs;
                        Parm->len = pche - pchs;
                        pch ++; /* move after trailing quote */
-                       if ((Parm->Type == TYPE_GETTEXT) && (*pch == ')')) {
+                       if (ParamBrace && (*pch == ')')) {
                                pch ++;
                        }