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: correctly treat absolute paths against dir #93

Merged
merged 1 commit into from
Nov 8, 2020

Conversation

zregvart
Copy link
Contributor

@zregvart zregvart commented Nov 7, 2020

I'm afraid a bug was introduced in #91: Absolute paths should be rooted from the --dir path, not against the base directory of the examined file. For example, given file in $DIR/sub/a.html with a link to /other/b.html and deadlinks invoked with --dir $DIR, that link should be evaluated as $DIR/other/b.html, not as $DIR/sub/other/b.html.

@zregvart zregvart force-pushed the pr/fix-absolute-paths-in-subdir branch 2 times, most recently from db7444a to 5793148 Compare November 7, 2020 20:04
@jyn514 jyn514 added the C-bug Category: This is a bug label Nov 7, 2020
Copy link
Contributor

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

Small nits, but otherwise looks good. Good catch, thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
src/parse.rs Outdated Show resolved Hide resolved
Absolute paths should be rooted from the `--dir` path, not against the
base directory of the examined file. For example, given file in
`$DIR/sub/a.html` with a link to `/other/b.html` and deadlinks invoked
with `--dir $DIR`, that link should be evaluated as `$DIR/other/b.html`,
not as `$DIR/sub/other/b.html`.
@zregvart zregvart force-pushed the pr/fix-absolute-paths-in-subdir branch from 5793148 to 622a1d5 Compare November 8, 2020 19:23
@jyn514 jyn514 merged commit 91e4bb6 into deadlinks:master Nov 8, 2020
@zregvart zregvart deleted the pr/fix-absolute-paths-in-subdir branch November 8, 2020 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants