blob: fea9f21d7896be583642cf0b9de0891b2fb61dba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* See LICENSE file for copyright and license details. */
#include "libsimple.h"
#ifndef TEST
char *
libsimple_strrcasechr_inv(const char *s_, int c) /* TODO test, man */
{
char *s = *(char **)(void *)&s_, lc = (char)tolower(c), uc = (char)toupper(c), *r = NULL;
if (lc != uc) {
for (; *s; s++)
if (*s != lc && *s != uc)
r = s;
} else {
for (; *s; s++)
if (*s != lc)
r = s;
}
return r;
}
#else
#include "test.h"
int
main(void)
{
return 0;
}
#endif
|