diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-07-09 00:10:06 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-07-09 00:10:06 +0200 |
commit | f907f1e3dcf7d6922cee4433297c3b4249d899e6 (patch) | |
tree | 35d431a76d0ac53cc9f3dd6647858ec8c724529b /common.c | |
parent | d3b1754e14b6508bddfda674edecbffdafe3d4f8 (diff) | |
download | xK-f907f1e3dcf7d6922cee4433297c3b4249d899e6.tar.gz xK-f907f1e3dcf7d6922cee4433297c3b4249d899e6.tar.xz xK-f907f1e3dcf7d6922cee4433297c3b4249d899e6.zip |
Add str_cut_until()
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -65,6 +65,12 @@ transform_str (char *s, int (*tolower) (int c)) *s = tolower (*s); } +static char * +str_cut_until (const char *s, const char *alphabet) +{ + return xstrndup (s, strcspn (s, alphabet)); +} + static void split_str (const char *s, char delimiter, struct str_vector *out) { |