FreeCalypso > hg > freecalypso-tools
annotate target-utils/libc/rindex.c @ 419:67d683a87b1d
rvinterf client refactoring: libinterf created
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 27 Oct 2018 23:35:10 +0000 |
parents | 7fb62fc724dc |
children |
rev | line source |
---|---|
87
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 char * |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 rindex(p, ch) |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 register char *p, ch; |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 { |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 register char *save; |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 for (save = 0;; ++p) { |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 if (*p == ch) |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 save = p; |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 if (!*p) |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 return(save); |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 } |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /* NOTREACHED */ |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 } |