rejeep / f.el

Modern API for working with files and directories in Emacs
GNU General Public License v3.0
680 stars 68 forks source link

f-split should not put a / in front if it's not the first character #98

Closed leodag closed 2 years ago

leodag commented 4 years ago

Would close #80.

Putting a path separator in front whenever a directory is absolute breaks in two cases:

Thus, a path separator should only be pushed to the parts of it is the first character.

The code in this PR comes with the assumption that path separators are always one character, but I found this assumption being made in other places too, so I guess it should be fine.

rejeep commented 4 years ago

Can you please add tests?

leodag commented 4 years ago

Whoops, looks like I forgot to add them, had meant to do it. I added two tests for the cases that were failing before.

Phundrak commented 2 years ago

Looks good to me, I’m merging this. Thanks for your contribution!