PR libstdc++/71044 fix off-by-one errors introduced recently
authorJonathan Wakely <jwakely@redhat.com>
Mon, 17 Dec 2018 22:43:31 +0000 (22:43 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 17 Dec 2018 22:43:31 +0000 (22:43 +0000)
commit2017595dfa6cb6a3629a493491b49f263b7c06ee
treebf98a4da1248df78980803fb1ae136e3eba5ba14
parent00fd062886928ee3617a171f31c1e4e07f65f38f
PR libstdc++/71044 fix off-by-one errors introduced recently

The recent changes to append/concat directly from strings (without
constructing paths) introduced regressions where one of the components
could be omitted from the iteration sequence in the result.

PR libstdc++/71044
* src/filesystem/std-path.cc (path::_M_append): Fix off-by-one error
that caused a component to be lost from the iteration sequence.
(path::_M_concat): Likewise.
* testsuite/27_io/filesystem/path/append/source.cc: Test appending
long strings.
* testsuite/27_io/filesystem/path/concat/strings.cc: Test
concatenating long strings.
* testsuite/27_io/filesystem/path/construct/string_view.cc: Test
construction from long string.

From-SVN: r267222
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/std-path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc
libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc
libstdc++-v3/testsuite/27_io/filesystem/path/construct/string_view.cc