Apply patches sent by Harlow Solutions -- for WebCit
[citadel.git] / webcit / subst.c
index 0cd7615f26b1b5746b8c4871be568aa9b2090e56..baaa5460c831c33584ca45802d738fe0c2647b08 100644 (file)
@@ -639,7 +639,12 @@ void StrBufAppendTemplate(StrBuf *Target,
                StrEscAppend(Target, Source, NULL, 0, 2);
                break;
        case 'X':
-               StrEscAppend(Target, Source, NULL, 0, 0);
+               if (!IsEmptyStr(ChrPtr(Source))) {
+                       StrEscAppend(Target, Source, NULL, 0, 0);
+                       if (pFmt[1]) {
+                               StrBufAppendBufPlain(Target, pFmt, -1, 1);
+                       }
+               }
                break;
        case 'J':
                StrECMAEscAppend(Target, Source, NULL);