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

This commit is contained in:
Gautier Pelloux-Prayer 2015-09-11 15:20:54 +02:00
parent 4abc46f753
commit e250b3c342
2 changed files with 5 additions and 3 deletions

@ -1 +1 @@
Subproject commit ec510dc8e9f01e717acce3e37538e7a49344a062
Subproject commit 19d44b552f46272f43a57f3370badd1a66663f58

View file

@ -196,9 +196,11 @@ int main (int argc, char *argv[])
liblinphone_tester_init(NULL);
// this allows to launch liblinphone_tester from outside of tester directory
// this allows to launch tester from outside of tester directory
if (strstr(argv[0], ".libs")) {
char* prefix = ms_strdup_printf("%s%s", argv[0][0]=='/'?"":"./", strstr(argv[0], ".libs"));
int prefix_length = strstr(argv[0], ".libs") - argv[0] + 1;
char *prefix = ms_strdup_printf("%s%.*s", argv[0][0] == '/' ? "" : "./", prefix_length, argv[0]);
ms_warning("Resource prefix set to %s", prefix);
bc_tester_set_resource_dir_prefix(prefix);
bc_tester_set_writable_dir_prefix(prefix);
ms_free(prefix);