Author: jim
Date: Wed Aug 14 15:51:11 2019
New Revision: 1865164
URL: http://svn.apache.org/viewvc?rev=1865164&view=rev
Log:
Align w/ 42X and trunk
Modified:
openoffice/branches/AOO417/main/sal/osl/unx/nlsupport.c
Modified: openoffice/branches/AOO417/main/sal/osl/unx/nlsupport.c
URL:
http://svn.apache.org/viewvc/openoffice/branches/AOO417/main/sal/osl/unx/nlsupport.c?rev=1865164&r1=1865163&r2=1865164&view=diff
==============================================================================
--- openoffice/branches/AOO417/main/sal/osl/unx/nlsupport.c (original)
+++ openoffice/branches/AOO417/main/sal/osl/unx/nlsupport.c Wed Aug 14 15:51:11
2019
@@ -876,31 +876,23 @@ void _imp_getProcessLocale( rtl_Locale *
* This is a hack. We know that we are setting some envvars here
* and due to https://bz.apache.org/ooo/show_bug.cgi?id=127965
* we need to update PATH on macOS. Doing it here ensures
- * that it's done but it's not the right location to be doing
+ * that it's done but it's not the perfect location to be doing
* this.
- *
- * Also address https://bz.apache.org/ooo/show_bug.cgi?id=127966
- * here as well :/
*/
opath = getenv ( "PATH" );
- slen = strlen( "/usr/local/bin" ) + 1;
- if ( opath != NULL )
- slen += strlen( ":" ) + strlen( opath );
- npath = malloc( slen );
- if ( opath != NULL ) {
- strcat( npath, opath );
- strcat( npath, ":" );
- }
- strcat( npath, "/usr/local/bin" ); /* We are adding at the end */
- setenv("PATH", npath, 1 );
- free(npath);
-
-/* https://bz.apache.org/ooo/show_bug.cgi?id=127966 */
- opath = getenv ( "HOME" );
- if ( opath && *opath ) {
- chdir ( opath );
- } else {
- chdir ( "/tmp" );
+ if (!strstr ( opath, "/usr/local/bin" )) {
+ slen = strlen( "/usr/local/bin" ) + 1;
+ if ( opath != NULL )
+ slen += strlen( ":" ) + strlen( opath );
+ npath = malloc( slen );
+ *npath = '\0';
+ if ( opath != NULL ) {
+ strcat( npath, opath );
+ strcat( npath, ":" );
+ }
+ strcat( npath, "/usr/local/bin" ); /* We are adding at the end */
+ setenv("PATH", npath, 1 );
+ free(npath);
}
#ifdef DEBUG