summaryrefslogtreecommitdiff
path: root/src/lib/utils.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-14 14:55:39 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-14 14:55:39 +0200
commit6271d09bdd17114c3095b7e819a7bcded14f26a5 (patch)
treea1c2a7bd200eb0343557524ddc80b0af6df4ec9e /src/lib/utils.c
parentddfc7091d2698d36c1cfec49eaaad96b278bb37b (diff)
parent95124310f647913a678060fc10155a0ad9311dba (diff)
downloadouroboros-6271d09bdd17114c3095b7e819a7bcded14f26a5.tar.gz
ouroboros-6271d09bdd17114c3095b7e819a7bcded14f26a5.zip
Merged in dstaesse/ouroboros/be-api (pull request #122)
lib, irmd, tools, ipcpd: updates to dev API.
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;
+}