virTestSetEnvPath: Avoid clearing out PATH

If the abs_builddir path already is in PATH and it's in the first
position, due to a bug in our code PATH would be cleared out.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-03-25 10:20:28 +01:00
parent d715bfac08
commit ee70fe7e14

View File

@ -822,7 +822,8 @@ virTestSetEnvPath(void)
goto cleanup; goto cleanup;
} }
if (setenv("PATH", new_path, 1) < 0) if (new_path &&
setenv("PATH", new_path, 1) < 0)
goto cleanup; goto cleanup;
ret = 0; ret = 0;