From 79317563e968cfbc5c3eae4bc0db30ee84a01b02 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sat, 20 Apr 2019 12:39:47 +0200 Subject: [PATCH] lib/conf.c: fix including absolute paths --- lib/conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/conf.c b/lib/conf.c index ad51f87e..6be6a425 100644 --- a/lib/conf.c +++ b/lib/conf.c @@ -221,13 +221,14 @@ static int parse_file(struct xbps_handle *, const char *, bool); static int parse_files_glob(struct xbps_handle *xhp, xbps_dictionary_t seen, - const char *path, const char *pat, bool nested) + const char *cwd, const char *pat, bool nested) { char tmppath[PATH_MAX]; glob_t globbuf; int rs, rv = 0; - rs = snprintf(tmppath, PATH_MAX, "%s/%s", path, pat); + rs = snprintf(tmppath, PATH_MAX, "%s/%s", + pat[0] == '/' ? xhp->rootdir : cwd, pat); if (rs < 0 || rs >= PATH_MAX) return ENOMEM;