diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2018-07-03 00:19:10 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2018-07-03 00:19:10 -0700 |
commit | ea77de493c75fc5b7fad10ef79b645e98d3f94e8 (patch) | |
tree | 832a12424c3b45f9756064c77e641da707b0bfe9 /test | |
parent | 22cfb83209a7da292a07b66945ca545cc0954524 (diff) |
Complete rewrite of NormalizePath
The former algorithm was based on the pseuocode
from the RFC, which is hard to follow, more suitable
when the path is in a single string, not a sequence
of segments.
The new algorithm uses two flags:
* isAbsolute - recognize that if the path starts out
as an absolute path, it needs to stay that way.
* atDirectoryLevel - recognize that if we encounter
a "." or "..", then it will be reduced by simply
discarding it or going back/up one stop, but then
we will be in a "directory" context, meaning that
should we end the path at this point, there needs
to be an empty-string segment to mark that the
end of the path is reaching into a directory, not
just referring to the directory.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions