forked from OctaForge/OctaBuild
use normal for loop in globmatcher
parent
2e98d0aecd
commit
b217bbcd65
5
globs.cc
5
globs.cc
|
@ -28,8 +28,7 @@ static void ob_get_path_parts(Vector<ConstCharRange> &parts,
|
||||||
|
|
||||||
static bool ob_path_matches(ConstCharRange fn,
|
static bool ob_path_matches(ConstCharRange fn,
|
||||||
const Vector<ConstCharRange> &parts) {
|
const Vector<ConstCharRange> &parts) {
|
||||||
auto it = parts.iter();
|
for (auto it = parts.iter(); !it.empty(); ++it) {
|
||||||
while (!it.empty()) {
|
|
||||||
ConstCharRange elem = it.front();
|
ConstCharRange elem = it.front();
|
||||||
if (elem == "*") {
|
if (elem == "*") {
|
||||||
++it;
|
++it;
|
||||||
|
@ -52,8 +51,6 @@ static bool ob_path_matches(ConstCharRange fn,
|
||||||
if (fn.slice(0, elem.size()) != elem)
|
if (fn.slice(0, elem.size()) != elem)
|
||||||
return false;
|
return false;
|
||||||
fn += elem.size();
|
fn += elem.size();
|
||||||
/* try next element */
|
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
/* if there are no chars in the fname remaining, we fully matched */
|
/* if there are no chars in the fname remaining, we fully matched */
|
||||||
return fn.empty();
|
return fn.empty();
|
||||||
|
|
Loading…
Reference in New Issue