Assume that DBUS_DATADIR is absolute on Windows

Both build systems arrange for this to be the case,
and we already assume that it's absolute on Unix.
On Windows, it's probably going to be /mingw/share or
something; it gets relocated via _dbus_replace_install_prefix()
at runtime.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
This commit is contained in:
Simon McVittie 2015-10-02 16:51:59 +01:00
parent 676d9c9d12
commit f5e5894a47
2 changed files with 7 additions and 25 deletions

View file

@ -3413,17 +3413,13 @@ test_default_session_servicedirs (void)
DBusString install_root_based;
if (!_dbus_string_init (&install_root_based) ||
!_dbus_get_install_root (&install_root_based))
_dbus_assert_not_reached ("OOM getting install root");
!_dbus_string_append (&install_root_based, DBUS_DATADIR) ||
!_dbus_replace_install_prefix (&install_root_based))
_dbus_assert_not_reached ("OOM getting relocated DBUS_DATADIR");
if (_dbus_string_get_length (&install_root_based) > 0)
{
if (!_dbus_string_append (&install_root_based, DBUS_DATADIR) ||
!_dbus_string_append (&install_root_based, "/dbus-1/services"))
_dbus_assert_not_reached ("OOM appending to install root");
_dbus_assert (_dbus_path_is_absolute (&install_root_based));
test_session_service_dir_matches[0] = _dbus_string_get_const_data (&install_root_based);
}
test_session_service_dir_matches[0] = _dbus_string_get_const_data (&install_root_based);
#endif

View file

@ -1574,16 +1574,14 @@ _dbus_get_standard_session_servicedirs (DBusList **dirs)
}
}
#else
/*
the code for accessing services requires absolute base pathes
in case DBUS_DATADIR is relative make it absolute
*/
{
DBusString p;
if (!_dbus_string_init (&p))
goto oom;
/* DBUS_DATADIR is assumed to be absolute; the build systems should
* ensure that. */
if (!_dbus_string_append (&p, DBUS_DATADIR) ||
!_dbus_replace_install_prefix (&p))
{
@ -1591,18 +1589,6 @@ _dbus_get_standard_session_servicedirs (DBusList **dirs)
goto oom;
}
if (!_dbus_path_is_absolute (&p))
{
/* this only works because this is the first thing in the
* servicedir_path; if it wasn't, we'd have to use a temporary
* string and copy it in */
if (!_dbus_get_install_root (&servicedir_path))
{
_dbus_string_free (&p);
goto oom;
}
}
if (!_dbus_string_append (&servicedir_path,
_dbus_string_get_const_data (&p)))
{