Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent negated patterns from traversing directory boundaries #41

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

arlyon
Copy link
Contributor

@arlyon arlyon commented May 24, 2023

Closes #40 by not pushing &&[^/] if we are already in a negation pattern, and just pushing the separator instead.

@arlyon arlyon force-pushed the fix/negated-dir-traversal branch from a34cc23 to 066ce98 Compare May 24, 2023 13:04
Copy link
Owner

@olson-sean-k olson-sean-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! This looks good aside from one refactor that I'd prefer and some style nitpicks regarding the tests.

src/encode.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@olson-sean-k
Copy link
Owner

Thanks for the PR and sorry for the radio silence! If you're still willing to land this, please let me know and take a look at the review. I realize this change was requested some time ago and I completely understand if you can't or don't want to get this landed now.

This change factors out some common code in class encoding and collapses
branches into a single branch. It also consolidates related tests into a
somewhat more general test case.
@olson-sean-k olson-sean-k merged commit a9862e8 into olson-sean-k:master Sep 25, 2023
14 checks passed
@arlyon
Copy link
Contributor Author

arlyon commented Oct 2, 2023

Hey! Apologies for just abandoning this, been very busy recently. I appreciate you taking the time to merge this 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Traverses directory boundaries when performing negative matching
2 participants