Commit 3b0d5047 authored by Thomas Haller's avatar Thomas Haller

shared: add nm_utils_dbus_path_get_last_component() helper

parent bb649fc3
......@@ -549,6 +549,19 @@ nm_cmp_int2ptr_p_with_data (gconstpointer p_a, gconstpointer p_b, gpointer user_
/*****************************************************************************/
const char *
nm_utils_dbus_path_get_last_component (const char *dbus_path)
{
if (dbus_path) {
dbus_path = strrchr (dbus_path, '/');
if (dbus_path)
return dbus_path + 1;
}
return NULL;
}
/*****************************************************************************/
/**
* nm_utils_strsplit_set:
* @str: the string to split.
......
......@@ -202,6 +202,10 @@ nm_utils_is_separator (const char c)
/*****************************************************************************/
const char *nm_utils_dbus_path_get_last_component (const char *dbus_path);
/*****************************************************************************/
const char **nm_utils_strsplit_set (const char *str, const char *delimiters);
gssize nm_utils_strv_find_first (char **list, gssize len, const char *needle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment