From 1675127c2a9d5e8e6fa1d3dd86a47a083d34bdb7 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 5 Nov 2024 16:48:11 +0100 Subject: Minor xs tweak. --- xs_glob.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xs_glob.h') diff --git a/xs_glob.h b/xs_glob.h index 24a6f56..15cb49a 100644 --- a/xs_glob.h +++ b/xs_glob.h @@ -4,21 +4,22 @@ #define _XS_GLOB_H -xs_list *xs_glob_n(const char *spec, int basename, int reverse, int max); -#define xs_glob(spec, basename, reverse) xs_glob_n(spec, basename, reverse, XS_ALL) +xs_list *xs_glob_n(const char *spec, int basename, int reverse, int mark, int max); +#define xs_glob(spec, basename, reverse) xs_glob_n(spec, basename, reverse, 0, XS_ALL) +#define xs_glob_m(spec, basename, reverse) xs_glob_n(spec, basename, reverse, 1, XS_ALL) #ifdef XS_IMPLEMENTATION #include -xs_list *xs_glob_n(const char *spec, int basename, int reverse, int max) +xs_list *xs_glob_n(const char *spec, int basename, int reverse, int mark, int max) /* does a globbing and returns the found files */ { glob_t globbuf; xs_list *list = xs_list_new(); - if (glob(spec, 0, NULL, &globbuf) == 0) { + if (glob(spec, mark ? GLOB_MARK : 0, NULL, &globbuf) == 0) { int n; if (max > (int) globbuf.gl_pathc) -- cgit