mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
parent
e0f0bb53f7
commit
12f393a55e
32 changed files with 569 additions and 122 deletions
29
src/fs.cpp
29
src/fs.cpp
|
|
@ -39,7 +39,6 @@
|
|||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <glob.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#include "fs.hpp"
|
||||
#include "xattr.hpp"
|
||||
|
|
@ -492,7 +491,7 @@ namespace fs
|
|||
if(rv == -1 && errno != ENOTTY)
|
||||
return -1;
|
||||
|
||||
return (errno = 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -515,32 +514,6 @@ namespace fs
|
|||
globfree(&gbuf);
|
||||
}
|
||||
|
||||
void
|
||||
erase_fnmatches(const vector<string> &patterns,
|
||||
vector<string> &strs)
|
||||
{
|
||||
vector<string>::iterator si;
|
||||
vector<string>::const_iterator pi;
|
||||
|
||||
si = strs.begin();
|
||||
while(si != strs.end())
|
||||
{
|
||||
int match = FNM_NOMATCH;
|
||||
|
||||
for(pi = patterns.begin();
|
||||
pi != patterns.end() && match != 0;
|
||||
++pi)
|
||||
{
|
||||
match = fnmatch(pi->c_str(),si->c_str(),0);
|
||||
}
|
||||
|
||||
if(match == 0)
|
||||
si = strs.erase(si);
|
||||
else
|
||||
++si;
|
||||
}
|
||||
}
|
||||
|
||||
namespace find
|
||||
{
|
||||
int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue