From b72ea77ed6d06699c2268137cae39ed36d67a6a8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 7 Dec 2024 18:05:16 -0500 Subject: get_files: empty pattern becomes '*' --- src/cli/stasis_indexer/helpers.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cli/stasis_indexer/helpers.c') diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c index 8279896..f67292f 100644 --- a/src/cli/stasis_indexer/helpers.c +++ b/src/cli/stasis_indexer/helpers.c @@ -220,6 +220,10 @@ int get_files(struct StrList **out, const char *path, const char *pattern, ...) char userpattern[PATH_MAX] = {0}; vsprintf(userpattern, pattern, args); va_end(args); + if (!strlen(userpattern)) { + userpattern[0] = '*'; + userpattern[1] = 0; + } struct StrList *list = listdir(path); if (!list) { return -1; -- cgit