From cc6f0239a367b736af679a141cd008aa8d9b25f1 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Fri, 15 Jul 2011 15:07:36 +0000 Subject: [PATCH] add new outputtoken 'F', which does FMOUT with the escaper. --- webcit/subst.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); } -- 2.30.2