From 38037aee8c2658f928daefb566c55184a4506e0f Mon Sep 17 00:00:00 2001 From: Richard Barber Date: Mon, 17 Feb 2020 11:24:05 -0800 Subject: [PATCH] mac:use a std::string --- rtgui/options.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/rtgui/options.cc b/rtgui/options.cc index 31b816a19..5b908d499 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -2272,15 +2272,15 @@ void Options::load(bool lightweight) #ifdef __APPLE__ // Build Application Support directory path for macOS. - const gchar* homedir = g_getenv("HOME"); // This returns the current container data dir in ~/Library - const gchar* configdir = "/Application Support/RawTherapee/config"; - gchar* homebuf = g_strnfill(789, 'a'); - gsize homelength = strlen(homedir); - g_stpcpy(homebuf, homedir); + const char* homedir = g_getenv("HOME"); // This returns the current container data dir in ~/Library + std::string configdir = "/Application Support/RawTherapee/config"; + std::string homebuf{homedir}; + int homelength = strlen(homebuf.c_str()); homebuf[homelength-45] = '\0'; - configdir = "/Application Support/RawTherapee/config"; // Back out of containers and into App. Support - const gchar* pathconcat = g_strconcat(homebuf, configdir); - path = pathconcat; + configdir = "/Application Support/RawTherapee/config"; + std::string configpath = homebuf + configdir; + path = configpath.c_str(); + std::cout<