tester.c: fix (again...) resource directory path

parent 86a007de
......@@ -131,7 +131,9 @@ int main (int argc, char *argv[]) {
// this allows to launch liblinphone_tester from outside of tester directory
if (strstr(argv[0], ".libs")) {
char* prefix = belle_sip_strdup_printf("%s%s", argv[0][0]=='/'?"":"./", strstr(argv[0], ".libs"));
int prefix_length = strstr(argv[0], ".libs") - argv[0] + 1;
char *prefix = belle_sip_strdup_printf("%s%.*s", argv[0][0] == '/' ? "" : "./", prefix_length, argv[0]);
belle_sip_warning("Resource prefix set to %s", prefix);
bc_tester_set_resource_dir_prefix(prefix);
bc_tester_set_writable_dir_prefix(prefix);
belle_sip_free(prefix);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment