From 4d3ad67ab37a25d0edfccdc34d29ec550e0802b6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 29 Dec 2015 11:52:12 -0600 Subject: Add strafter() to lib. --- lib/lib.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/lib.c') 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) { -- cgit v1.2.3