summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/filesystem/path
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-01-04 11:43:09 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2019-01-04 11:43:09 +0000
commitb30802179a0af4a6328b086d7bcab6fa7d294e3c (patch)
tree4243ddb73cbfd3fb790497a98f47362b08bc020c /libstdc++-v3/testsuite/27_io/filesystem/path
parent5db78cac104c0427b023b3a21f98bf302aa736e3 (diff)
Fix concatenation bug in filesystem::path
When erasing a trailing empty filename component, the output iterator was not decremented, causing the next component to be created at the wrong position. * src/filesystem/std-path.cc (path::operator+=(const path&)): Fix incorrect treatment of empty filename after trailing slash. * testsuite/27_io/filesystem/path/concat/path.cc: Test problem case. From-SVN: r267574
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/filesystem/path')
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/path/concat/path.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/concat/path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/concat/path.cc
index b653219a7f7..e2a14bd8fcc 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/concat/path.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/concat/path.cc
@@ -59,9 +59,18 @@ test02()
}
}
+void
+test03()
+{
+ path p = "a/";
+ p += path("/b");
+ compare_paths(p, "a//b");
+}
+
int
main()
{
test01();
test02();
+ test03();
}