summaryrefslogtreecommitdiff
path: root/src/lib/utils.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-14 14:56:55 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-14 14:56:55 +0200
commit337ab9fe73b86306b72b9eaae3b7be759f7bbd36 (patch)
treed7b237631ef17df911ec4aef766aba085a63bd30 /src/lib/utils.c
parent6019a5b1ee574c8cea485ce5ba68ff77a24b4786 (diff)
parent6271d09bdd17114c3095b7e819a7bcded14f26a5 (diff)
downloadouroboros-337ab9fe73b86306b72b9eaae3b7be759f7bbd36.tar.gz
ouroboros-337ab9fe73b86306b72b9eaae3b7be759f7bbd36.zip
Merge remote-tracking branch 'upstream/be' into be-llc
Diffstat (limited to 'src/lib/utils.c')
-rw-r--r--src/lib/utils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/utils.c b/src/lib/utils.c
index 5744fb7c..49065138 100644
--- a/src/lib/utils.c
+++ b/src/lib/utils.c
@@ -53,3 +53,21 @@ char * strdup(const char * src)
return dst;
}
+
+char * path_strip(char * src)
+{
+ char * dst = NULL;
+
+ if (src == NULL)
+ return NULL;
+
+ dst = src + strlen(src);
+
+ while (dst > src && *dst != '/')
+ --dst;
+
+ if (*dst == '/')
+ ++dst;
+
+ return dst;
+}