add new outputtoken 'F', which does FMOUT with the escaper.
authorWilfried Goesgens <dothebart@citadel.org>
Fri, 15 Jul 2011 15:07:36 +0000 (15:07 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:36:28 +0000 (21:36 +0000)
webcit/subst.c

index 1a08abc245f131cc1a3fed562d130db4862b8848..cf6c9e130399ad5a3e051141377dfde810c26397 100644 (file)
@@ -620,12 +620,14 @@ void StrBufAppendTemplate(StrBuf *Target,
                          const StrBuf *Source, int FormatTypeIndex)
 {
         wcsession *WCC;
+       const char *pFmt = NULL;
        char EscapeAs = ' ';
 
        if ((FormatTypeIndex < TP->Tokens->nParameters) &&
            (TP->Tokens->Params[FormatTypeIndex]->Type == TYPE_STR) &&
-           (TP->Tokens->Params[FormatTypeIndex]->len == 1)) {
-               EscapeAs = *TP->Tokens->Params[FormatTypeIndex]->Start;
+           (TP->Tokens->Params[FormatTypeIndex]->len >= 1)) {
+               pFmt = TP->Tokens->Params[FormatTypeIndex]->Start;
+               EscapeAs = pFmt;
        }
 
        switch(EscapeAs)
@@ -646,6 +648,12 @@ void StrBufAppendTemplate(StrBuf *Target,
        case 'U':
                StrBufUrlescAppend(Target, Source, NULL);
                break;
+       case 'F':
+               if (pFmt != NULL)       pFmt++;
+               else                    pFmt = "JUSTIFY";
+               if (*pFmt == '\0')      pFmt = "JUSTIFY";
+               FmOut(Target, pFmt, Source);
+               break;
        default:
                StrBufAppendBuf(Target, Source, 0);
        }