[Issue 13825] relativePath not handling "." and ".." correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 13 12:35:43 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=13825

dechcaudron+dlang.issue.tracking at protonmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |dechcaudron+dlang.issue.tra
                   |                            |cking at protonmail.com

--- Comment #2 from dechcaudron+dlang.issue.tracking at protonmail.com ---
Hi Thibaut,

I'm taking this one. The same behavior is exhibited on the range returned by
"asRelativePath". At a first glance, the proposed fix will indeed be to indeed
call "buildNormalizedPath" on each of the arguments, but I need to look into
memory allocation considerations.

Regarding your last comment:
> but there is still an issue if the first path starts with "../"

Even though the docs do not explicitly mention so, I believe the first argument
is expected to be an absolute path (otherwise, you would be changing an
out-of-context relative path into another relative path, which looks like a bad
idea to me). Perhaps it would be a good idea to add a contract on both
parameters (but that is a breaking change that I assume would require a
deprecation period, let's see what the maintainers say). Thus, a first argument
that starts with ".." would fall out of this category.

Regards,
Dechcaudron

--


More information about the Digitalmars-d-bugs mailing list