summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common.c b/common.c
index 94d5aa4..12e1eff 100644
--- a/common.c
+++ b/common.c
@@ -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)
{