259 |
const char *p; |
const char *p; |
260 |
p = strrchr(filename, '/'); |
p = strrchr(filename, '/'); |
261 |
if (!p) { |
if (!p) { |
262 |
/* should also scan for ':' */ |
/* should also scan for ':' */ |
263 |
return filename; |
return filename; |
264 |
} else { |
} else { |
265 |
p++; |
p++; |
354 |
const char *p; |
const char *p; |
355 |
|
|
356 |
if (casefold) { |
if (casefold) { |
357 |
pstrcpy(buf, sizeof(buf), str); |
pstrcpy(buf, sizeof(buf), str); |
358 |
str = buf; |
str = buf; |
359 |
css_strtolower(buf, sizeof(buf)); |
css_strtolower(buf, sizeof(buf)); |
360 |
} |
} |
361 |
c = *str; |
c = *str; |
362 |
len = strlen(str); |
len = strlen(str); |
363 |
/* need to special case the empty string */ |
/* need to special case the empty string */ |
364 |
if (len == 0) |
if (len == 0) |
365 |
return strstr(keytable, "||") != NULL; |
return strstr(keytable, "||") != NULL; |
366 |
|
|
367 |
/* initial and trailing | are optional */ |
/* initial and trailing | are optional */ |
368 |
/* they do not cause the empty string to match */ |
/* they do not cause the empty string to match */ |
369 |
for (p = keytable;;) { |
for (p = keytable;;) { |
370 |
if (!memcmp(p, str, len) && (p[len] == '|' || p[len] == '\0')) |
if (!memcmp(p, str, len) && (p[len] == '|' || p[len] == '\0')) |
371 |
return 1; |
return 1; |
372 |
for (;;) { |
for (;;) { |
373 |
p = strchr(p + 1, c); |
p = strchr(p + 1, c); |
374 |
if (!p) |
if (!p) |
375 |
return 0; |
return 0; |
376 |
if (p[-1] == '|') |
if (p[-1] == '|') |
377 |
break; |
break; |
378 |
} |
} |
379 |
} |
} |
380 |
} |
} |
381 |
|
|
397 |
return c; |
return c; |
398 |
} |
} |
399 |
|
|
400 |
int ustristart(const unsigned int *str, const char *val, const unsigned int **ptr) |
int ustristart(const unsigned int *str, const char *val, |
401 |
|
const unsigned int **ptr) |
402 |
{ |
{ |
403 |
const unsigned int *p; |
const unsigned int *p; |
404 |
const char *q; |
const char *q; |