rockbox/apps/plugins/lua/strcspn.c
Maurus Cuelenaere cf87597226 Commit FS#9174: Lua scripting language by Dan Everton
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21020 a1c6a512-1295-4272-9138-f99709370657
2009-05-21 19:01:41 +00:00

16 lines
246 B
C

#include "rocklibc.h"
size_t strcspn(const char *s, const char *reject)
{
size_t l=0;
int a=1,i,al=strlen(reject);
while((a)&&(*s))
{
for(i=0;(a)&&(i<al);i++)
if (*s==reject[i]) a=0;
if (a) l++;
s++;
}
return l;
}