Bell 32V development
authorTom London <tbl@research.uucp>
Sat, 20 Jan 1979 04:51:52 +0000 (23:51 -0500)
committerTom London <tbl@research.uucp>
Sat, 20 Jan 1979 04:51:52 +0000 (23:51 -0500)
Work on file usr/src/libc/gen/rindex.c

Co-Authored-By: John Reiser <jfr@research.uucp>
Synthesized-from: 32v

usr/src/libc/gen/rindex.c [new file with mode: 0644]

diff --git a/usr/src/libc/gen/rindex.c b/usr/src/libc/gen/rindex.c
new file mode 100644 (file)
index 0000000..af1ff76
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Return the ptr in sp at which the character c last
+ * appears; NULL if not found
+*/
+
+#define NULL 0
+
+char *
+rindex(sp, c)
+register char *sp, c;
+{
+       register char *r;
+
+       r = NULL;
+       do {
+               if (*sp == c)
+                       r = sp;
+       } while (*sp++);
+       return(r);
+}