diff --git common/rclinit.cpp common/rclinit.cpp index 45ba5741..e5eed5e2 100644 --- common/rclinit.cpp +++ common/rclinit.cpp @@ -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, "");