final touches on dkim test harness
[citadel.git] / webcit / subst.c
index 0cd7615f26b1b5746b8c4871be568aa9b2090e56..f6725cd58aa654b84465fe41a9bc8ac3fc9168bc 100644 (file)
@@ -15,7 +15,7 @@
 #define SHOW_ME_VAPPEND_PRINTF
 
 #include "webcit.h"
-#include "webserver.h"
+
 
 extern char *static_dirs[PATH_MAX];  /* Disk representation */
 
@@ -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);