Changeset 9349


Ignore:
Timestamp:
03/26/08 22:52:29 (5 years ago)
Author:
BrainSlayer
Message:

seems to be buggy on xscale, so we revert it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/ej.c

    r9341 r9349  
    88#include <shutils.h> 
    99#include "httpd.h" 
    10 #include <endian.h> 
    1110 
    1211 
     
    2524 
    2625#define LOG(a)                  //fprintf(stderr,"%s\n",a); 
    27  
    28 #if __BYTE_ORDER == __LITTLE_ENDIAN 
    29 #define AUF (unsigned short)'%<' 
    30 #define ZU (unsigned short)'>%' 
    31 #elif __BYTE_ORDER == __BIG_ENDIAN 
    32 #define AUF (unsigned short)'<%' 
    33 #define ZU (unsigned short)'%>' 
    34 #else 
    35 #error "unknown endian type 
    36 #endif 
    3726 
    3827 
     
    5443/* Look for unquoted character within a string */ 
    5544static char * 
    56 unqstrstr (char *haystack, unsigned short needle) 
     45unqstrstr (char *haystack, char *needle) 
    5746{ 
    5847  char *cur; 
    5948  int q; 
    60   int haylen = strlen(haystack); 
     49  int needlelen = strlen(needle); 
     50  int haylen = strlen (haystack); 
    6151  for (cur = haystack, q = 0; 
    62        cur < &haystack[haylen] && !(!q && *((unsigned short*)cur)==needle);cur++) 
     52       cur < &haystack[haylen] && !(!q && !strncmp (needle, cur, needlelen)); 
     53       cur++) 
    6354    { 
    6455      if (*cur == '"') 
     
    271262            } 
    272263        } 
    273       if (!asp) 
    274         { 
    275           if (len==1 && pattern[0]=='<') 
    276                 continue; 
    277           if (pattern[1]=='%') 
    278           { 
    279                 asp = pattern + 2; 
    280                 continue; 
    281           } 
    282         } 
    283        
     264      if (!asp && !strncmp (pattern, "<%", len)) 
     265        { 
     266          if (len == 2) 
     267            asp = pattern + 2; 
     268          continue; 
     269        } 
    284270 
    285271      /* Look for ... %> */ 
     
    287273      if (asp) 
    288274        { 
    289           if (unqstrstr (asp, ZU)) 
     275          if (unqstrstr (asp, "%>")) 
    290276            { 
    291277              for (func = asp; func < &pattern[len]; func = end) 
Note: See TracChangeset for help on using the changeset viewer.