Changeset 9349
- Timestamp:
- 03/26/08 22:52:29 (5 years ago)
- File:
-
- 1 edited
-
src/router/httpd/ej.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/httpd/ej.c
r9341 r9349 8 8 #include <shutils.h> 9 9 #include "httpd.h" 10 #include <endian.h>11 10 12 11 … … 25 24 26 25 #define LOG(a) //fprintf(stderr,"%s\n",a); 27 28 #if __BYTE_ORDER == __LITTLE_ENDIAN29 #define AUF (unsigned short)'%<'30 #define ZU (unsigned short)'>%'31 #elif __BYTE_ORDER == __BIG_ENDIAN32 #define AUF (unsigned short)'<%'33 #define ZU (unsigned short)'%>'34 #else35 #error "unknown endian type36 #endif37 26 38 27 … … 54 43 /* Look for unquoted character within a string */ 55 44 static char * 56 unqstrstr (char *haystack, unsigned shortneedle)45 unqstrstr (char *haystack, char *needle) 57 46 { 58 47 char *cur; 59 48 int q; 60 int haylen = strlen(haystack); 49 int needlelen = strlen(needle); 50 int haylen = strlen (haystack); 61 51 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++) 63 54 { 64 55 if (*cur == '"') … … 271 262 } 272 263 } 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 } 284 270 285 271 /* Look for ... %> */ … … 287 273 if (asp) 288 274 { 289 if (unqstrstr (asp, ZU))275 if (unqstrstr (asp, "%>")) 290 276 { 291 277 for (func = asp; func < &pattern[len]; func = end)
Note: See TracChangeset
for help on using the changeset viewer.
