summary refs log tree commit diff
path: root/str.c
diff options
context:
space:
mode:
Diffstat (limited to 'str.c')
-rw-r--r--str.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/str.c b/str.c
index 10d64e1..e0ea194 100644
--- a/str.c
+++ b/str.c
@@ -58,3 +58,12 @@ int strv_split(strv_t *src, int chr, strv_t *dest) {
 	src->n -= dest->n + !!c;
 	return dest->n > 0;
 }
+
+char strv_next(strv_t *s) {
+	if (s->n > 0) {
+		s->n--;
+		return *(s->s++);
+	} else {
+		return 0;
+	}
+}