summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 99edd835..4d3c511a 100644
--- a/lib.c
+++ b/lib.c
@@ -999,6 +999,9 @@ val split_str(val str, val sep)
const wchar_t *csep = c_str(sep);
size_t len_sep = c_num(length_str(sep));
+ prot1(&str);
+ prot1(&sep);
+
list_collect_decl (out, iter);
for (; *cstr != 0; cstr += len_sep) {
@@ -1010,6 +1013,9 @@ val split_str(val str, val sep)
cstr += span;
}
+ rel1(&sep);
+ rel1(&str);
+
return out;
}
@@ -1019,6 +1025,9 @@ val split_str_set(val str, val set)
const wchar_t *cset = c_str(set);
list_collect_decl (out, iter);
+ prot1(&str);
+ prot1(&set);
+
for (; *cstr != 0; cstr++) {
size_t span = wcscspn(cstr, cset);
val piece = mkustring(num(span));
@@ -1027,6 +1036,9 @@ val split_str_set(val str, val set)
cstr += span;
}
+ rel1(&set);
+ rel1(&str);
+
return out;
}