From 0d0a2b9657c78b45b1e2946afd3bc9ef225b4b79 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 18 Nov 2022 18:03:09 -0500 Subject: [PATCH] bin/xbps-rindex/remove-obsoletes.c: always opendir() pwd If repodir is given as a relative path, it will not work because it will try to open the dir relative to itself because it already chdir()ed into repodir. This fixes xbps-rindex -r when relative paths are specified. fixes #519 --- bin/xbps-rindex/remove-obsoletes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xbps-rindex/remove-obsoletes.c b/bin/xbps-rindex/remove-obsoletes.c index eba4ee82..40ef8df9 100644 --- a/bin/xbps-rindex/remove-obsoletes.c +++ b/bin/xbps-rindex/remove-obsoletes.c @@ -134,7 +134,7 @@ remove_obsoletes(struct xbps_handle *xhp, const char *repodir) rv = errno; goto out; } - if ((dirp = opendir(repodir)) == NULL) { + if ((dirp = opendir(".")) == NULL) { fprintf(stderr, "xbps-rindex: failed to open %s: %s\n", repodir, strerror(errno)); rv = errno;