diff options
Diffstat (limited to 'src/user/knob/block.c')
-rw-r--r-- | src/user/knob/block.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/user/knob/block.c b/src/user/knob/block.c index 1720f94..5b4590f 100644 --- a/src/user/knob/block.c +++ b/src/user/knob/block.c @@ -73,4 +73,14 @@ void str_trunc_fill(char *str, uint32_t len) { str[j] = ' '; str[len] = '\0'; } +} + +__attribute__ ((pure)) +uint32_t str_find_any(const char *str, const char *delims) { + const char *i; + for (i = str; *i; ++i) + for (const char *j = delims; *j; ++j) + if (*i == *j) + return i - str; + return i - str; }
\ No newline at end of file |