source: trunk/sys/dietlibc/strrchr.c @ 335

Last change on this file since 335 was 1, checked in by alain, 8 years ago

First import

File size: 515 bytes
Line 
1#include <string.h>
2#include "dietfeatures.h"
3
4char *strrchr(const char *t, int c) {
5  register char ch;
6  register const char *l=0;
7
8  ch = c;
9  for (;;) {
10    if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
11#ifndef WANT_SMALL_STRING_ROUTINES
12    if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
13    if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
14    if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
15#endif
16  }
17  return (char*)l;
18}
19
20char *rindex(const char *t,int c)       __attribute__((weak,alias("strrchr")));
Note: See TracBrowser for help on using the repository browser.