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

bugfix: uneffective erase during path resolution

During resolution of `..` component the last slash position won't be updated.
parent d780a0f9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -104,6 +104,11 @@ unsigned int path_match_components(const std::string& path, unsigned int &path_c
            // component is '..' we need to rollback resolved path
            if (resolved.size() > 0) {
                resolved.erase(last_slash_pos);
                /* TODO     Optimization
                 * the previous slash position should be stored.
                 * The following search could be avoided.
                 */
                last_slash_pos = resolved.find_last_of(PSP);
            }
            if (resolved_components > 0) {
                if (matched_components == resolved_components) {