This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r263923 - in /branches/gcc-8-branch/libstdc++-v...
- From: redi at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Tue, 28 Aug 2018 15:52:19 -0000
- Subject: r263923 - in /branches/gcc-8-branch/libstdc++-v...
Author: redi
Date: Tue Aug 28 15:52:18 2018
New Revision: 263923
URL: https://gcc.gnu.org/viewcvs?rev=263923&root=gcc&view=rev
Log:
PR libstdc++/87116 fix path::lexically_normal() handling of dot-dot
Previously the logic that turned "a/b/c/../.." into "a/" failed to
preserve an empty path at the end of the iteration sequence, as required
by the trailing slash. That meant the result didn't meet the class
invariants, and that "a/b/c/d/../../.." would remove four components
instead of the three that "../../.." should remove.
PR libstdc++/87116
* src/filesystem/std-path.cc (path::lexically_normal): When handling
a dot-dot filename, preserve an empty final component in the iteration
sequence.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use preferred-separator for
root-directory.
* testsuite/27_io/filesystem/path/generation/normal.cc: Add new tests
for more than two adjacent dot-dot filenames.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Replace slashes with
preferred-separator in expected normalized strings.
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/src/filesystem/std-path.cc
branches/gcc-8-branch/libstdc++-v3/testsuite/27_io/filesystem/path/generation/normal.cc