pajoye Sun, 11 Oct 2009 21:04:35 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=289547
Log:
- fix possible issue in TS environment (we don't have to do that anymore anyway
in 5.3+)
Changed paths:
U php/php-src/branches/PHP_5_3/main/php_ini.c
U php/php-src/trunk/main/php_ini.c
Modified: php/php-src/branches/PHP_5_3/main/php_ini.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-11 20:50:53 UTC (rev
289546)
+++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-11 21:04:35 UTC (rev
289547)
@@ -507,33 +507,18 @@
}
strlcat(php_ini_search_path, default_location,
search_path_size);
}
- efree(default_location);
- {
- /* For people running under terminal services,
GetWindowsDirectory will
- * return their personal Windows directory, so lets add
the system
- * windows directory too */
- typedef UINT (WINAPI
*get_system_windows_directory_func)(char *buffer, UINT size);
- static get_system_windows_directory_func
get_system_windows_directory = NULL;
- HMODULE kern;
-
- if (get_system_windows_directory == NULL) {
- kern = LoadLibrary("kernel32.dll");
- if (kern) {
- get_system_windows_directory =
(get_system_windows_directory_func)GetProcAddress(kern,
"GetSystemWindowsDirectoryA");
- }
+ /* For people running under terminal services,
GetWindowsDirectory will
+ * return their personal Windows directory, so lets add the
system
+ * windows directory too */
+ if (0 < GetSystemWindowsDirectory(default_location,
MAXPATHLEN)) {
+ if (*php_ini_search_path) {
+ strlcat(php_ini_search_path, paths_separator,
search_path_size);
}
- if (get_system_windows_directory != NULL) {
- default_location = (char *) emalloc(MAXPATHLEN
+ 1);
- if (0 <
get_system_windows_directory(default_location, MAXPATHLEN)) {
- if (*php_ini_search_path) {
- strlcat(php_ini_search_path,
paths_separator, search_path_size);
- }
- strlcat(php_ini_search_path,
default_location, search_path_size);
- }
- efree(default_location);
- }
+ strlcat(php_ini_search_path, default_location,
search_path_size);
}
+ efree(default_location);
+
#else
default_location = PHP_CONFIG_FILE_PATH;
if (*php_ini_search_path) {
Modified: php/php-src/trunk/main/php_ini.c
===================================================================
--- php/php-src/trunk/main/php_ini.c 2009-10-11 20:50:53 UTC (rev 289546)
+++ php/php-src/trunk/main/php_ini.c 2009-10-11 21:04:35 UTC (rev 289547)
@@ -505,33 +505,18 @@
}
strlcat(php_ini_search_path, default_location,
search_path_size);
}
- efree(default_location);
- {
- /* For people running under terminal services,
GetWindowsDirectory will
- * return their personal Windows directory, so lets add
the system
- * windows directory too */
- typedef UINT (WINAPI
*get_system_windows_directory_func)(char *buffer, UINT size);
- static get_system_windows_directory_func
get_system_windows_directory = NULL;
- HMODULE kern;
-
- if (get_system_windows_directory == NULL) {
- kern = LoadLibrary("kernel32.dll");
- if (kern) {
- get_system_windows_directory =
(get_system_windows_directory_func)GetProcAddress(kern,
"GetSystemWindowsDirectoryA");
- }
+ /* For people running under terminal services,
GetWindowsDirectory will
+ * return their personal Windows directory, so lets add the
system
+ * windows directory too */
+ if (0 < GetSystemWindowsDirectory(default_location,
MAXPATHLEN)) {
+ if (*php_ini_search_path) {
+ strlcat(php_ini_search_path, paths_separator,
search_path_size);
}
- if (get_system_windows_directory != NULL) {
- default_location = (char *) emalloc(MAXPATHLEN
+ 1);
- if (0 <
get_system_windows_directory(default_location, MAXPATHLEN)) {
- if (*php_ini_search_path) {
- strlcat(php_ini_search_path,
paths_separator, search_path_size);
- }
- strlcat(php_ini_search_path,
default_location, search_path_size);
- }
- efree(default_location);
- }
+ strlcat(php_ini_search_path, default_location,
search_path_size);
}
+ efree(default_location);
+
#else
default_location = PHP_CONFIG_FILE_PATH;
if (*php_ini_search_path) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php