aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-12-29 11:52:12 -0600
committerRob Landley <rob@landley.net>2015-12-29 11:52:12 -0600
commit4d3ad67ab37a25d0edfccdc34d29ec550e0802b6 (patch)
tree2ea5d17313d4efbd358add3d45580244c1190136 /lib/lib.c
parent1bf844232802d2deec7a2e9bee355e4c26259101 (diff)
downloadtoybox-4d3ad67ab37a25d0edfccdc34d29ec550e0802b6.tar.gz
Add strafter() to lib.
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c8
1 files changed, 8 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)
{