* scan for XML files while reading a template; xml shares the same notation as our...
authorWilfried Göesgens <willi@citadel.org>
Thu, 1 Oct 2009 19:03:49 +0000 (19:03 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 1 Oct 2009 19:03:49 +0000 (19:03 +0000)
webcit/subst.c

index fbbb6b8e108f0653a3d10fd453c80f581d19c678..8bf67c1c8dff0c32b75843296cbe55306552d9c9 100644 (file)
@@ -1505,7 +1505,11 @@ void *load_template(StrBuf *filename, StrBuf *Key, HashList *PutThere)
                /** Find one <? > */
                pos = (-1);
                for (; pch < pE; pch ++) {
-                       if ((*pch=='<')&&(*(pch + 1)=='?'))
+                       if ((*pch=='<')&&(*(pch + 1)=='?') &&
+                           !((pch == pS) && /* we must ommit a <?xml */
+                             (*(pch + 2) == 'x') && 
+                             (*(pch + 3) == 'm') && 
+                             (*(pch + 4) == 'l')))                          
                                break;
                        if (*pch=='\n') Line ++;
                }