macports: ensure the GUI finds recollindex

This commit is contained in:
Jean-Francois Dockes 2019-09-27 11:36:31 +02:00
parent a88549452d
commit 9c111fba29

View File

@ -273,6 +273,18 @@ RclConfig *recollinit(int flags,
if (cleanup)
atexit(cleanup);
#ifdef MACPORTS
// Apple keeps changing the way to set the environment (PATH) for
// a desktop app (started by launchd or whatever). Life is too
// short.
const char *cp = getenv("PATH");
if (!cp) //??
cp = "";
string PATH(cp);
PATH = string("/opt/local/bin/") + ":" + PATH;
setenv("PATH", PATH.c_str(), 1);
#endif
// Make sure the locale is set. This is only for converting file names
// to utf8 for indexing.
setlocale(LC_CTYPE, "");