RE: Can we change org.openobex.Client's dbus node path?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
>so first, please fix the coding style here. I can tell from just the
>pure email that you are mixing up tabs and spaces and also that you
>are missing whitespaces here and there. Check that your mail client
>doesn't mangle it. If in doubt send it as attachment.
>
>Regards
>
>Marcel


Hi Marcel

Thanks for point out the tabs and spaces issue, I think this is might be related to my terminal setting when I do the copy/paste with the diff output. And 3 whitespaces added. So here it is:

---------------------------------------------------------------------------

diff --git a/gdbus/object.c b/gdbus/object.c
index a417ab9..9cf6f09 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -299,25 +299,28 @@ static void invalidate_parent_data(DBusConnection *conn, const char *child_path)
 	char *parent_path, *slash;
 
 	parent_path = g_strdup(child_path);
-	slash = strrchr(parent_path, '/');
-	if (!slash)
-		goto done;
-
-	*slash = '\0';
-	if (!strlen(parent_path))
-		goto done;
+	do {
+		slash = strrchr(parent_path, '/');
+		if (!slash)
+			break;
 
-	if (!dbus_connection_get_object_path_data(conn, parent_path,
-							(void *) &data))
-		goto done;
+		if (slash == parent_path) {
+			*(slash + 1) = '\0';
+		} else {
+			*slash = '\0';
+		}
 
-	if (!data)
-		goto done;
+		if (!dbus_connection_get_object_path_data(conn, parent_path,
+								(void *) &data))
+			continue;
 
-	g_free(data->introspect);
-	data->introspect = NULL;
+		if (!data)
+			continue;
 
-done:
+		g_free(data->introspect);
+		data->introspect = NULL;
+	} while (slash != parent_path);
+	
 	g_free(parent_path);
 }

---------------------------------------------

Raymond
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux