aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c8
-rw-r--r--lib/lib.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 5ee7325c..c89aeb60 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -342,6 +342,14 @@ char *strlower(char *s)
return try;
}
+// strstr but returns pointer after match
+char *strafter(char *haystack, char *needle)
+{
+ char *s = strstr(haystack, needle);
+
+ return s ? s+strlen(needle) : s;
+}
+
// Remove trailing \n
char *chomp(char *s)
{
diff --git a/lib/lib.h b/lib/lib.h
index 5f70c8cc..235b208f 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -173,6 +173,7 @@ long atolx(char *c);
long atolx_range(char *numstr, long low, long high);
int stridx(char *haystack, char needle);
char *strlower(char *s);
+char *strafter(char *haystack, char *needle);
char *chomp(char *s);
int unescape(char c);
int strstart(char **a, char *b);