From 29cef0e7ad7f1208b5fcd0d0259d7fe6182b4a8f Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Sun, 6 Jun 2021 00:23:49 -0700 Subject: [PATCH] I guess GLOB_PERIOD is Linux or GNU extension. <shrug> Fix FreeBSD build error: dirwrap.c:760:13: error: use of undeclared identifier 'GLOB_PERIOD' Not sure how glob() on FreeBSD treats "dot files" or how to control that. --- src/xpdev/dirwrap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xpdev/dirwrap.c b/src/xpdev/dirwrap.c index b8d9057dd3..723ba54d9d 100644 --- a/src/xpdev/dirwrap.c +++ b/src/xpdev/dirwrap.c @@ -744,6 +744,13 @@ long delfiles(const char *inpath, const char *spec, size_t keep) long errors = 0; glob_t g; size_t inpath_len=strlen(inpath); + int flags = +#ifdef GLOB_PERIOD + GLOB_PERIOD +#else + 0 +#endif + ; if(inpath_len==0) lastch=0; @@ -757,7 +764,7 @@ long delfiles(const char *inpath, const char *spec, size_t keep) else strcpy(path,inpath); strcat(path,spec); - glob(path, GLOB_PERIOD, NULL, &g); + glob(path, flags, NULL, &g); free(path); if(keep >= g.gl_pathc) return 0; -- GitLab