From 004150a5305d0df06c52a51a0df3ac26dd4a63cd Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 6 Jun 2023 16:27:43 -0400 Subject: SL-18837: Concat path part with / rather than +=. Using concatenation appends the intended filename to the parent directory name, instead of putting the filename in the parent directory. --- indra/test/namedtempfile.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/test/namedtempfile.h b/indra/test/namedtempfile.h index da4fec97c8..c215c50f3f 100644 --- a/indra/test/namedtempfile.h +++ b/indra/test/namedtempfile.h @@ -84,10 +84,12 @@ protected: const std::string_view& sfx) { // Create file in a temporary place. - boost::filesystem::path tempname{ boost::filesystem::temp_directory_path() }; - // unique_path() recommended template, but with underscores instead of - // hyphens: some use cases involve temporary Python scripts - tempname += stringize(pfx, "%%%%_%%%%_%%%%_%%%%", sfx); + boost::filesystem::path tempname{ + boost::filesystem::temp_directory_path() / + // unique_path() recommended template, but with underscores + // instead of hyphens: some use cases involve temporary Python + // scripts + stringize(pfx, "%%%%_%%%%_%%%%_%%%%", sfx) }; mPath = boost::filesystem::unique_path(tempname); boost::filesystem::ofstream out{ mPath }; -- cgit v1.2.3