shared: fix search_and_fopen with alternate roots

Update for the current behavior of path_strv_resolve which now returns
paths relative to the given root, not the full absolute paths.

(cherry picked from commit 375eadd911)
(cherry picked from commit 686e842aec)
This commit is contained in:
Michael Marineau
2014-06-21 11:13:01 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent a2d2b499ee
commit ff96d0f2ca
+4 -1
View File
@@ -5701,7 +5701,10 @@ static int search_and_fopen_internal(const char *path, const char *mode, const c
_cleanup_free_ char *p = NULL;
FILE *f;
p = strjoin(*i, "/", path, NULL);
if (root)
p = strjoin(root, *i, "/", path, NULL);
else
p = strjoin(*i, "/", path, NULL);
if (!p)
return -ENOMEM;