repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
builtins
/
lib
/
strrchr.c
blob
30a567a99933903a77e570e804ed8a623a0b90e9
1
extern
int
inside_main
;
2
3
char
*
4
strrchr
(
const char
*
s
,
int
c
)
5
{
6
__SIZE_TYPE__ i
;
7
8
#ifdef __OPTIMIZE__
9
if
(
inside_main
)
10
abort
();
11
#endif
12
13
i
=
0
;
14
while
(
s
[
i
] !=
0
)
15
i
++;
16
17
do
18
if
(
s
[
i
] ==
c
)
19
return
(
char
*)
s
+
i
;
20
while
(
i
-- !=
0
);
21
22
return
0
;
23
}
24
25
char
*
26
rindex
(
const char
*
s
,
int
c
)
27
{
28
return
strrchr
(
s
,
c
);
29
}