Misc cleanup (#1486)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled

* Skip non-directories when loading branches
* Warn if branch doesn't exist
* Add braces to globbing
This commit is contained in:
trapexit 2025-06-25 22:43:49 -05:00 • committed by GitHub
parent be49dbe1bd
commit 264c5600f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 94 additions and 173 deletions

View file

@ -23,6 +23,13 @@
using std::string;
using std::vector;
#ifndef GLOB_BRACE
#define GLOB_BRACE 0
#endif
#ifndef GLOB_ONLYDIR
#define GLOB_ONLYDIR 0
#endif
namespace fs
{
@ -33,7 +40,7 @@ namespace fs
int flags;
glob_t gbuf = {0};
flags = GLOB_NOCHECK;
flags = (GLOB_BRACE|GLOB_ONLYDIR);
::glob(pattern_.c_str(),flags,NULL,&gbuf);
for(size_t i = 0; i < gbuf.gl_pathc; i++)