From: Michal Privoznik Date: Fri, 25 Mar 2016 09:20:28 +0000 (+0100) Subject: virTestSetEnvPath: Avoid clearing out PATH X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ee70fe7e1487f4047313f87555bd496f97719093;p=libvirt.git 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 --- diff --git a/tests/testutils.c b/tests/testutils.c index d6cd1936d0..fc4c339bb7 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -822,7 +822,8 @@ virTestSetEnvPath(void) goto cleanup; } - if (setenv("PATH", new_path, 1) < 0) + if (new_path && + setenv("PATH", new_path, 1) < 0) goto cleanup; ret = 0;