forked from enlightenment/efl
parent
0bc346c979
commit
312bb0d887
|
@ -489,6 +489,7 @@ edbus_service_shutdown(void)
|
||||||
static EDBus_Service_Object *
|
static EDBus_Service_Object *
|
||||||
_edbus_service_object_parent_find(EDBus_Service_Object *obj)
|
_edbus_service_object_parent_find(EDBus_Service_Object *obj)
|
||||||
{
|
{
|
||||||
|
EDBus_Service_Object *parent = NULL;
|
||||||
size_t len = strlen(obj->path);
|
size_t len = strlen(obj->path);
|
||||||
char *path = strdup(obj->path);
|
char *path = strdup(obj->path);
|
||||||
char *slash;
|
char *slash;
|
||||||
|
@ -496,22 +497,18 @@ _edbus_service_object_parent_find(EDBus_Service_Object *obj)
|
||||||
for (slash = path[len] != '/' ? &path[len - 1] : &path[len - 2];
|
for (slash = path[len] != '/' ? &path[len - 1] : &path[len - 2];
|
||||||
slash > path; slash--)
|
slash > path; slash--)
|
||||||
{
|
{
|
||||||
EDBus_Service_Object *parent = NULL;
|
|
||||||
|
|
||||||
if (*slash != '/')
|
if (*slash != '/')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
|
|
||||||
if (dbus_connection_get_object_path_data(obj->conn->dbus_conn, path,(void **)&parent) && parent != NULL)
|
if (dbus_connection_get_object_path_data(obj->conn->dbus_conn,
|
||||||
{
|
path, (void **) &parent) && parent != NULL)
|
||||||
free(path);
|
break;
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(path);
|
free(path);
|
||||||
return NULL;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDBus_Service_Object *
|
static EDBus_Service_Object *
|
||||||
|
|
Loading…
Reference in New Issue