summaryrefslogtreecommitdiff
path: root/libkern/strchr-spim.c
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2009-04-01 22:54:06 +0000
committerCharles.Forsyth <devnull@localhost>2009-04-01 22:54:06 +0000
commit4eb166cf184c1f102fb79e31b1465ea3e2021c39 (patch)
tree0e1bd8c059324d5cb99d625a67398e48a9ffce95 /libkern/strchr-spim.c
parenta9b1d9c7f57ec21ff8be147f5c949966b966e519 (diff)
20090401-2350
Diffstat (limited to 'libkern/strchr-spim.c')
-rw-r--r--libkern/strchr-spim.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libkern/strchr-spim.c b/libkern/strchr-spim.c
new file mode 100644
index 00000000..1d4d425c
--- /dev/null
+++ b/libkern/strchr-spim.c
@@ -0,0 +1,18 @@
+#include <lib9.h>
+
+char*
+strchr(char *s, int c)
+{
+ char c1;
+
+ if(c == 0) {
+ while(*s++)
+ ;
+ return s-1;
+ }
+
+ while(c1 = *s++)
+ if(c1 == c)
+ return s-1;
+ return 0;
+}