mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
keep literal when glob fails
This commit is contained in:
parent
8c3462caf2
commit
9afefef032
6 changed files with 83 additions and 29 deletions
26
src/fs.cpp
26
src/fs.cpp
|
|
@ -18,7 +18,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <glob.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -170,31 +169,6 @@ namespace fs
|
|||
return (errno=ENOENT,-1);
|
||||
}
|
||||
|
||||
void
|
||||
glob(const vector<string> &patterns,
|
||||
vector<string> &strs)
|
||||
{
|
||||
int flags;
|
||||
size_t veclen;
|
||||
glob_t gbuf = {0};
|
||||
|
||||
veclen = patterns.size();
|
||||
if(veclen == 0)
|
||||
return;
|
||||
|
||||
flags = 0;
|
||||
glob(patterns[0].c_str(),flags,NULL,&gbuf);
|
||||
|
||||
flags = GLOB_APPEND;
|
||||
for(size_t i = 1; i < veclen; i++)
|
||||
glob(patterns[i].c_str(),flags,NULL,&gbuf);
|
||||
|
||||
for(size_t i = 0; i < gbuf.gl_pathc; ++i)
|
||||
strs.push_back(gbuf.gl_pathv[i]);
|
||||
|
||||
globfree(&gbuf);
|
||||
}
|
||||
|
||||
void
|
||||
realpathize(vector<string> &strs)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue