dbus-send: Print an error message if object path is syntactically invalid

$ dbus-send // nope
    Object path was not valid: '//'

Related to dbus#338.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2021-06-21 12:02:27 +01:00
parent ef55a3db0d
commit dde5c8fdc4

View file

@ -417,6 +417,13 @@ main (int argc, char *argv[])
usage (1);
}
if (!dbus_validate_path (path, &error))
{
fprintf (stderr, "%s\n", error.message);
dbus_error_free (&error);
exit (1);
}
if (address != NULL)
{
connection = dbus_connection_open (address, &error);