From edf9b4964d28f0f18552ff39c8f182b7903e19e3 Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sat, 26 Aug 2023 08:53:45 +0100 Subject: Reuse TempDir() function --- googletest/src/gtest-port.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 589ace5..628ab3d 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -1067,10 +1067,7 @@ class CapturedStream { // // However, prefer using the TMPDIR environment variable if set, as newer // devices may have /data/local/tmp read-only. - if (auto tmpdir = ::getenv("TMPDIR")) - name_template.assign(tmpdir) += '/'; - else - name_template = "/data/local/tmp/"; + name_template = TempDir(); #elif defined(GTEST_OS_IOS) char user_temp_dir[PATH_MAX + 1]; -- cgit v0.12