aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/compare_string_array.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 731d3d8c1..7b5ce856d 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -67,3 +67,12 @@ int index_in_substrings(const char *strings, const char *key)
}
return -1;
}
+
+const char *nth_string(const char *strings, int n)
+{
+ while (n) {
+ n--;
+ strings += strlen(strings) + 1;
+ }
+ return strings;
+}