Last change
on this file since ee49131 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
534 bytes
|
Rev | Line | |
---|
[3ae31e9] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | strrchr.c -- find last occurrence of a character in a string
|
---|
| 4 | Version 1 -- 1987-06-12
|
---|
| 5 |
|
---|
| 6 | Return the ptr in sp at which the character c last
|
---|
| 7 | appears; NULL if not found.
|
---|
| 8 | =============================================================================
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | #define NULL (char *)0
|
---|
| 12 |
|
---|
| 13 | char *
|
---|
| 14 | strrchr(sp, c)
|
---|
| 15 | register char *sp, c;
|
---|
| 16 | {
|
---|
| 17 | register char *r;
|
---|
| 18 |
|
---|
| 19 | r = NULL;
|
---|
| 20 |
|
---|
| 21 | do {
|
---|
| 22 |
|
---|
| 23 | if (*sp == c)
|
---|
| 24 | r = sp;
|
---|
| 25 |
|
---|
| 26 | } while(*sp++);
|
---|
| 27 |
|
---|
| 28 | return(r);
|
---|
| 29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.