home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
STRRCHR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
670b
|
35 lines
/* from Henry Spencer's stringlib */
#include <string.h>
/*
* strrchr - find last occurrence of a character in a string
*/
#ifdef __GNUC__
asm(".text; .even; .globl _rindex; _rindex:"); /* dept of dirty tricks */
#else
char *
rindex(s, charwanted)
const char *s;
char charwanted;
{
return strrchr(s, charwanted);
}
#endif
char * /* found char, or NULL if none */
strrchr(s, charwanted)
const char *s;
register char charwanted;
{
register char c;
register const char *place;
place = NULL;
while (c = *s++)
if (c == charwanted)
place = s - 1;
if (charwanted == '\0')
return((char *)--s);
return (char *)place;
}