the following path layout
install-root/
bin/dbus-daemon[d].exe
- etc/<config-file>.conf
+ etc/<config-file>.conf *or* etc/dbus-1/<config-file>.conf
+ (the former above is what dbus4win uses, the latter above is
+ what a "normal" Unix-style "make install" uses)
build-root/
bin/dbus-daemon[d].exe
{
char path[MAX_PATH*2];
int path_size = sizeof(path);
- int len = 4 + strlen(s);
if (!_dbus_get_install_root(path,path_size))
return FALSE;
- if(len > sizeof(path)-2)
+ if(strlen(s) + 4 + strlen(path) > sizeof(path)-2)
return FALSE;
strcat(path,"etc\\");
strcat(path,s);
{
if (!_dbus_get_install_root(path,path_size))
return FALSE;
- if(len + strlen(path) > sizeof(path)-2)
+ if(strlen(s) + 11 + strlen(path) > sizeof(path)-2)
return FALSE;
- strcat(path,"bus\\");
+ strcat(path,"etc\\dbus-1\\");
strcat(path,s);
if (_dbus_file_exists(path))
if (!_dbus_string_append (config_file, path))
return FALSE;
}
+ else
+ {
+ if (!_dbus_get_install_root(path,path_size))
+ return FALSE;
+ if(strlen(s) + 4 + strlen(path) > sizeof(path)-2)
+ return FALSE;
+ strcat(path,"bus\\");
+ strcat(path,s);
+
+ if (_dbus_file_exists(path))
+ {
+ if (!_dbus_string_append (config_file, path))
+ return FALSE;
+ }
+ }
}
return TRUE;
}