From: Wilfried Goesgens Date: Fri, 15 Jul 2011 15:07:36 +0000 (+0000) Subject: add new outputtoken 'F', which does FMOUT with the escaper. X-Git-Tag: v8.11~573 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=cc6f0239a367b736af679a141cd008aa8d9b25f1 add new outputtoken 'F', which does FMOUT with the escaper. --- diff --git a/webcit/subst.c b/webcit/subst.c index 1a08abc24..cf6c9e130 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -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); }