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

broken links with "--dir" #42

Closed
leapfog opened this issue Feb 13, 2020 · 6 comments
Closed

broken links with "--dir" #42

leapfog opened this issue Feb 13, 2020 · 6 comments
Assignees
Labels
bug This is a bug

Comments

@leapfog
Copy link

leapfog commented Feb 13, 2020

'algernon --dir .' creates proper links to the files in the current folder, but 'algernon --dir ./' creates broken links: each linked file's first char has been removed. A file called "foo" is linked as "oo". I confirmed this with versions 1.12.5 and 1.12.6 on Linux.

@xyproto
Copy link
Owner

xyproto commented Feb 13, 2020

Thanks for reporting! I'll look into this and fix it.

@xyproto
Copy link
Owner

xyproto commented Feb 13, 2020

Bug confirmed, will fix.

@xyproto xyproto closed this as completed Feb 13, 2020
@xyproto xyproto reopened this Feb 13, 2020
@xyproto xyproto self-assigned this Feb 13, 2020
@xyproto xyproto added the bug This is a bug label Feb 13, 2020
@xyproto
Copy link
Owner

xyproto commented Feb 13, 2020

Fixed in master. Please test.

@xyproto xyproto closed this as completed Feb 13, 2020
@leapfog
Copy link
Author

leapfog commented Feb 17, 2020

The fix helps, current master doesn't create broken links anymore. Playing a bit around it seems that algernon doesn't cleanup/canonicalize rootdir, so a usage like "--dir $PWD/../../www/" unnecessarily exposes the (name of the) current working directory.

@xyproto
Copy link
Owner

xyproto commented Feb 17, 2020

Thanks for testing.

I created a branch named reldir, where the relative directory is used instead.

If it's an improvement, I'll merge it to master.

@leapfog
Copy link
Author

leapfog commented Mar 11, 2020

I tested again with latest git, but the reldir modification does not (always) do what I had expected, see the following example:

$ mkdir -p dir1a/dir2a dir1a/dir2b/dir3

$ algernon.git --dir $PWD/dir1a/dir2a/../dir2b/dir3/./// --httponly --verbose

good: algernon shows "dir1a/dir2b/dir3/"
(maybe "dir3" or just "/" would be even better)

$ algernon.git --dir dir1a/dir2a/../dir2b/dir3/./// --httponly --verbose

bad: algernon shows "dir1a/dir2a/../dir2b/dir3/.//"

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

No branches or pull requests

2 participants