lib/conf.c: fix including absolute paths
This commit is contained in:
parent
3533af846f
commit
79317563e9
@ -221,13 +221,14 @@ static int parse_file(struct xbps_handle *, const char *, bool);
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
parse_files_glob(struct xbps_handle *xhp, xbps_dictionary_t seen,
|
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];
|
char tmppath[PATH_MAX];
|
||||||
glob_t globbuf;
|
glob_t globbuf;
|
||||||
int rs, rv = 0;
|
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)
|
if (rs < 0 || rs >= PATH_MAX)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user