You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ji...@apache.org on 2019/01/18 18:50:36 UTC

svn commit: r1851637 - in /openoffice/trunk/main: odk/source/unoapploader/unx/unoapploader.c sal/osl/unx/nlsupport.c sal/osl/unx/process_impl.cxx

Author: jim
Date: Fri Jan 18 18:50:36 2019
New Revision: 1851637

URL: http://svn.apache.org/viewvc?rev=1851637&view=rev
Log:
more PATH weirdness on macOS

Modified:
    openoffice/trunk/main/odk/source/unoapploader/unx/unoapploader.c
    openoffice/trunk/main/sal/osl/unx/nlsupport.c
    openoffice/trunk/main/sal/osl/unx/process_impl.cxx

Modified: openoffice/trunk/main/odk/source/unoapploader/unx/unoapploader.c
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/source/unoapploader/unx/unoapploader.c?rev=1851637&r1=1851636&r2=1851637&view=diff
==============================================================================
--- openoffice/trunk/main/odk/source/unoapploader/unx/unoapploader.c (original)
+++ openoffice/trunk/main/odk/source/unoapploader/unx/unoapploader.c Fri Jan 18 18:50:36 2019
@@ -206,10 +206,10 @@ int main( int argc, char *argv[] )
             strcat( envstr, value );
 		}
         putenv( envstr );
-    #ifdef MACOSX
+#ifdef MACOSX
         /* https://bz.apache.org/ooo/show_bug.cgi?id=127965 */
         value = getenv( "PATH" );
-        size = strlen( "PATH" ) + strlen( "=/usr/local/bin" );
+        size = strlen( "PATH" ) + strlen( "=/usr/local/bin" ) + 1;
         if ( value != NULL )
             size += strlen( PATHSEPARATOR ) + strlen( value );
 		envstr = (char*) malloc( size );
@@ -220,7 +220,7 @@ int main( int argc, char *argv[] )
         }
         strcat( envstr, "/usr/local/bin" ); /* We are adding at the end */
         putenv( envstr );
-    #endif
+#endif
     }
     else
     {

Modified: openoffice/trunk/main/sal/osl/unx/nlsupport.c
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/unx/nlsupport.c?rev=1851637&r1=1851636&r2=1851637&view=diff
==============================================================================
--- openoffice/trunk/main/sal/osl/unx/nlsupport.c (original)
+++ openoffice/trunk/main/sal/osl/unx/nlsupport.c Fri Jan 18 18:50:36 2019
@@ -832,6 +832,8 @@ int macosx_getLocale(char *locale, sal_u
 void _imp_getProcessLocale( rtl_Locale ** ppLocale )
 {
     static char *locale = NULL;
+    char *npath, *opath;
+    int slen;
 
     /* basic thread safeness */
 //    pthread_mutex_lock( &aLocalMutex );
@@ -870,6 +872,26 @@ void _imp_getProcessLocale( rtl_Locale *
     setenv("LC_CTYPE", locale, 1 );
     setenv("LANG", locale, 1 );
 
+    /*
+     * 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
+     * this.
+     */
+    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);
+
 #ifdef DEBUG
     fprintf( stderr, "nlsupport.c:  _imp_getProcessLocale() returning %s as current locale.\n", locale );
 #endif

Modified: openoffice/trunk/main/sal/osl/unx/process_impl.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/unx/process_impl.cxx?rev=1851637&r1=1851636&r2=1851637&view=diff
==============================================================================
--- openoffice/trunk/main/sal/osl/unx/process_impl.cxx (original)
+++ openoffice/trunk/main/sal/osl/unx/process_impl.cxx Fri Jan 18 18:50:36 2019
@@ -385,7 +385,7 @@ oslProcessError SAL_CALL osl_clearEnviro
 	rtl_TextEncoding encoding = osl_getThreadTextEncoding();
 	rtl_String* pstr_env_var  = 0;
 
-	OSL_PRECOND(pustrEnvVar, "osl_setEnvironment(): Invalid parameter");
+	OSL_PRECOND(pustrEnvVar, "osl_clearEnvironment(): Invalid parameter");
 
 	rtl_uString2String(
 		&pstr_env_var,