Sub->Sub = Super->Sub;
Super->Sub = Sub;
}
+ if (Sub->Sub != NULL)
+ Sub->Sub->Super = Sub;
Sub->Super = Super;
Sub->Context = Context;
{
Sub->Super->Sub = Sub->Sub;
}
+ if (Sub->Sub != NULL)
+ {
+ Sub->Sub->Super = Sub->Super;
+ }
}
void UnStackDynamicContext(StrBuf *Target, WCTemplputParams **TPP)
{
*/
}
-
-
-
void LogError (StrBuf *Target, const char *Type, const char *Format, ...)
{
wcsession *WCC;
return 1;
LogTemplateError(
- Target, ErrType, ERR_PARM1, TP,
+ Target, ErrType, ERR_NAME, TP,
" WARNING: requires Context: [%s], have [%s]!",
ContextName(Need->ContextType),
ContextName(TP->Filter.ContextType));
{
char *MinorPtr;
-#ifdef _DIRENT_HAVE_D_NAMELEN
+#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namelen;
+
+#else
+ d_namelen = strlen(filedir_entry->d_name);
+#endif
+
+#ifdef _DIRENT_HAVE_D_TYPE
d_type = filedir_entry->d_type;
#else
#define IFTODT(mode) (((mode) & 0170000) >> 12)
#define DTTOIF(dirtype) ((dirtype) << 12)
#endif
- d_namelen = strlen(filedir_entry->d_name);
d_type = DT_UNKNOWN;
#endif
d_without_ext = d_namelen;
char path[PATH_MAX];
snprintf(path, PATH_MAX, "%s/%s",
ChrPtr(DirName), filedir_entry->d_name);
- if (stat(path, &s) == 0) {
+ if (lstat(path, &s) == 0) {
d_type = IFTODT(s.st_mode);
}
}
LoadTemplateDir(SubDirectory, big, SubKey);
break;
- case DT_LNK: /* TODO: check whether its a file or a directory */
+ case DT_LNK:
case DT_REG:
WCTemplputParams TP;
WCTemplputParams *TPtr = &TP;
+ memset(TPtr, 0, sizeof(WCTemplputParams));
+
memcpy(&TP.Filter, &CallingTP->Filter, sizeof(ContextFilter));
TP.Context = CallingTP->Context;
res = Cond->CondF(Target, TP);
if (res == Neg)
rc = TP->Tokens->Params[1]->lvalue;
+
if (LoadTemplates > 5)
syslog(1, "<%s> : %d %d==%d\n",
ChrPtr(TP->Tokens->FlatToken),
rc, res, Neg);
+
if (TP->Sub != NULL)
{
*TPP = TP->Sub;