summaryrefslogtreecommitdiff
path: root/lib/neardal_tools.c
diff options
context:
space:
mode:
authorOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>2014-08-19 13:36:31 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2014-09-08 00:38:53 +0200
commit93d77f01cc46b8e4452227bb527d027a3112d28c (patch)
treeefb524ad40fa064af46cd62a9b1135988832926c /lib/neardal_tools.c
parentd60884033429a43f4c7266d452de091ebba63301 (diff)
downloadneardal-93d77f01cc46b8e4452227bb527d027a3112d28c.tar.gz
neardal-93d77f01cc46b8e4452227bb527d027a3112d28c.tar.bz2
neardal-93d77f01cc46b8e4452227bb527d027a3112d28c.zip
Move neardal_dirname() to tools.
Diffstat (limited to 'lib/neardal_tools.c')
-rw-r--r--lib/neardal_tools.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/neardal_tools.c b/lib/neardal_tools.c
index 34d5b43..36f17c0 100644
--- a/lib/neardal_tools.c
+++ b/lib/neardal_tools.c
@@ -66,6 +66,13 @@ void *neardal_g_variant_get(GVariant *data, const char *key, const char *fmt)
return out;
}
+char *neardal_dirname(const char *path)
+{
+ char *tmp = strrchr(path, '/');
+
+ return tmp ? g_strndup(path, tmp - path) : NULL;
+}
+
/*****************************************************************************
* neardal_tools_prv_free_gerror: freeing gerror in neardal context
****************************************************************************/