repo.or.cz
/
haiku.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
headers/bsd: Add sys/queue.h.
[haiku.git]
/
src
/
system
/
libroot
/
posix
/
string
/
strrchr.c
blob
0bb3195170187fd79753525170de980a28d7c7e5
1
/*
2
* Copyright 2001, Manuel J. Petit. All rights reserved.
3
* Distributed under the terms of the NewOS License.
4
*/
5
6
7
#include <string.h>
8
#include <strings.h>
9
#include <sys/types.h>
10
11
12
char
*
13
strrchr
(
char const
*
s
,
int
c
)
14
{
15
char const
*
last
=
NULL
;
16
17
for
(;;
s
++) {
18
if
(*
s
== (
char
)
c
)
19
last
=
s
;
20
if
(*
s
==
'\0'
)
21
break
;
22
}
23
24
return
(
char
*)
last
;
25
}
26
27
28
char
*
29
rindex
(
char const
*
s
,
int
c
)
30
{
31
return
strrchr
(
s
,
c
);
32
}
33