diff --git a/tools/test-runner.c b/tools/test-runner.c
index 25ff521..8caf351 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
else
snprintf(initcmd, sizeof(initcmd), "%s/%s", cwd, own_binary);
- if (test_argv[0][0] == '/')
- pos = snprintf(testargs, sizeof(testargs), "%s", test_argv[0]);
- else
- pos = snprintf(testargs, sizeof(testargs), "%s/%s",
- cwd, test_argv[0]);
+ pos = snprintf(testargs, sizeof(testargs), "%s", test_argv[0]);
for (i = 1; i < test_argc; i++) {
int len = sizeof(testargs) - pos;
}
if (pid == 0) {
+ if (home) {
+ printf("Changing into directory %s\n", home + 5);
+ if (chdir(home + 5) < 0)
+ perror("Failed to change directory");
+ }
+
execve(argv[0], argv, envp);
exit(EXIT_SUCCESS);
}