Skip to content
Snippets Groups Projects
Commit 29cef0e7 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

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.
parent 1c7f68a0
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2353 passed
...@@ -744,6 +744,13 @@ long delfiles(const char *inpath, const char *spec, size_t keep) ...@@ -744,6 +744,13 @@ long delfiles(const char *inpath, const char *spec, size_t keep)
long errors = 0; long errors = 0;
glob_t g; glob_t g;
size_t inpath_len=strlen(inpath); size_t inpath_len=strlen(inpath);
int flags =
#ifdef GLOB_PERIOD
GLOB_PERIOD
#else
0
#endif
;
if(inpath_len==0) if(inpath_len==0)
lastch=0; lastch=0;
...@@ -757,7 +764,7 @@ long delfiles(const char *inpath, const char *spec, size_t keep) ...@@ -757,7 +764,7 @@ long delfiles(const char *inpath, const char *spec, size_t keep)
else else
strcpy(path,inpath); strcpy(path,inpath);
strcat(path,spec); strcat(path,spec);
glob(path, GLOB_PERIOD, NULL, &g); glob(path, flags, NULL, &g);
free(path); free(path);
if(keep >= g.gl_pathc) if(keep >= g.gl_pathc)
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment