]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/port/runestrchr.c
libregexp: improve the transition to next available thread, instruction, and generation
[plan9front.git] / sys / src / libc / port / runestrchr.c
1 #include <u.h>
2 #include <libc.h>
3
4 Rune*
5 runestrchr(Rune *s, Rune c)
6 {
7         Rune c0 = c;
8         Rune c1;
9
10         if(c == 0) {
11                 while(*s++)
12                         ;
13                 return s-1;
14         }
15
16         while(c1 = *s++)
17                 if(c1 == c0)
18                         return s-1;
19         return 0;
20 }