nlsupport.c (a2264196) | nlsupport.c (4aba5f85) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 862 unchanged lines hidden (view full) --- 871 setenv( "LC_ALL", locale, 1); 872 setenv("LC_CTYPE", locale, 1 ); 873 setenv("LANG", locale, 1 ); 874 875 /* 876 * This is a hack. We know that we are setting some envvars here 877 * and due to https://bz.apache.org/ooo/show_bug.cgi?id=127965 878 * we need to update PATH on macOS. Doing it here ensures | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 862 unchanged lines hidden (view full) --- 871 setenv( "LC_ALL", locale, 1); 872 setenv("LC_CTYPE", locale, 1 ); 873 setenv("LANG", locale, 1 ); 874 875 /* 876 * This is a hack. We know that we are setting some envvars here 877 * and due to https://bz.apache.org/ooo/show_bug.cgi?id=127965 878 * we need to update PATH on macOS. Doing it here ensures |
879 * that it's done but it's not the right location to be doing | 879 * that it's done but it's not the perfect location to be doing |
880 * this. | 880 * this. |
881 * 882 * Also address https://bz.apache.org/ooo/show_bug.cgi?id=127966 883 * here as well :/ | |
884 */ 885 opath = getenv ( "PATH" ); | 881 */ 882 opath = getenv ( "PATH" ); |
886 slen = strlen( "/usr/local/bin" ) + 1; 887 if ( opath != NULL ) 888 slen += strlen( ":" ) + strlen( opath ); 889 npath = malloc( slen ); 890 if ( opath != NULL ) { 891 strcat( npath, opath ); 892 strcat( npath, ":" ); | 883 if (!strstr ( opath, "/usr/local/bin" )) { 884 slen = strlen( "/usr/local/bin" ) + 1; 885 if ( opath != NULL ) 886 slen += strlen( ":" ) + strlen( opath ); 887 npath = malloc( slen ); 888 *npath = '\0'; 889 if ( opath != NULL ) { 890 strcat( npath, opath ); 891 strcat( npath, ":" ); 892 } 893 strcat( npath, "/usr/local/bin" ); /* We are adding at the end */ 894 setenv("PATH", npath, 1 ); 895 free(npath); |
893 } | 896 } |
894 strcat( npath, "/usr/local/bin" ); /* We are adding at the end */ 895 setenv("PATH", npath, 1 ); 896 free(npath); | |
897 | 897 |
898/* https://bz.apache.org/ooo/show_bug.cgi?id=127966 */ 899 opath = getenv ( "HOME" ); 900 if ( opath && *opath ) { 901 chdir ( opath ); 902 } else { 903 chdir ( "/tmp" ); 904 } 905 | |
906#ifdef DEBUG 907 fprintf( stderr, "nlsupport.c: _imp_getProcessLocale() returning %s as current locale.\n", locale ); 908#endif 909 910// pthread_mutex_unlock( &aLocalMutex ); 911 912} 913#else --- 65 unchanged lines hidden --- | 898#ifdef DEBUG 899 fprintf( stderr, "nlsupport.c: _imp_getProcessLocale() returning %s as current locale.\n", locale ); 900#endif 901 902// pthread_mutex_unlock( &aLocalMutex ); 903 904} 905#else --- 65 unchanged lines hidden --- |