diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2014-04-02 20:46:06 +0200 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2014-04-02 20:46:06 +0200 |
commit | bfd0179042b0b02fb88748d54e56e7e208bb117f (patch) | |
tree | 42d5fd51574054caaf673420fca1ec962d62d2f2 /apps/plugins/lua/strcspn.c | |
parent | 36378988ad4059982742f05f5eb50580b456840a (diff) | |
download | rockbox-bfd0179042b0b02fb88748d54e56e7e208bb117f.tar.gz rockbox-bfd0179042b0b02fb88748d54e56e7e208bb117f.zip |
Revert "Update lua plugin to 5.2.3"
FILE typedef to *void needs more work to not break sim and
application builds. I checked only a few random native builds
unfortunately. Sorry for inconvenience.
Diffstat (limited to 'apps/plugins/lua/strcspn.c')
-rw-r--r-- | apps/plugins/lua/strcspn.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/plugins/lua/strcspn.c b/apps/plugins/lua/strcspn.c new file mode 100644 index 0000000000..0a19eaebf2 --- /dev/null +++ b/apps/plugins/lua/strcspn.c | |||
@@ -0,0 +1,17 @@ | |||
1 | #include "rocklibc.h" | ||
2 | |||
3 | #undef strcspn | ||
4 | size_t strcspn(const char *s, const char *reject) | ||
5 | { | ||
6 | size_t l=0; | ||
7 | int a=1,i,al=strlen(reject); | ||
8 | |||
9 | while((a)&&(*s)) | ||
10 | { | ||
11 | for(i=0;(a)&&(i<al);i++) | ||
12 | if (*s==reject[i]) a=0; | ||
13 | if (a) l++; | ||
14 | s++; | ||
15 | } | ||
16 | return l; | ||
17 | } | ||