Verified Commit d780a0f9 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

bugfix: path resolution matched components decrement

number of matched component should be decremented only when
component that was counted as matched gets removed.

for instance when `/tmp/ext/..` gets resolved to `/tmp` we should not
decrement the matched counter cause we didn't match ext before.
parent 20108549
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -106,11 +106,11 @@ unsigned int path_match_components(const std::string& path, unsigned int &path_c
                resolved.erase(last_slash_pos);
            }
            if (resolved_components > 0) {
                --resolved_components;
            }
            if (matched_components > 0) {
                if (matched_components == resolved_components) {
                    --matched_components;
                }
                --resolved_components;
            }
            continue;
        }