]> git.pld-linux.org Git - packages/php.git/blame - php-ini-search-path.patch
- reverted, commited to wrong branch
[packages/php.git] / php-ini-search-path.patch
CommitLineData
32d8246b 1see also http://bugs.php.net/bug.php?id=34793
230ac6e7
ER
2
3--- php-5.1.2/main/php_ini.c 2006-01-17 17:01:16.000000000 +0200
4+++ php-5.1.4/main/php_ini.c 2006-06-12 11:16:06.594944020 +0300
5@@ -291,10 +291,10 @@
6 } else if (!sapi_module.php_ini_ignore) {
7 char *default_location;
8 char *env_location;
9- char *binary_location;
10 static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 };
11 #ifdef PHP_WIN32
12 char *reg_location;
13+ char *binary_location;
14 #endif
15
16 env_location = getenv("PHPRC");
32d8246b
ER
17@@ -330,6 +330,7 @@
18 strcat(php_ini_search_path, env_location);
19 }
20
21+#ifdef PHP_WIN32
22 /* Add cwd (only with CLI) */
23 if (strcmp(sapi_module.name, "cli") == 0) {
24 if (*php_ini_search_path) {
230ac6e7 25@@ -339,23 +340,12 @@
32d8246b
ER
26 }
27
28 /* Add binary directory */
29-#ifdef PHP_WIN32
30 binary_location = (char *) emalloc(MAXPATHLEN);
31 if (GetModuleFileName(0, binary_location, MAXPATHLEN) == 0) {
32 efree(binary_location);
32d8246b
ER
33 binary_location = NULL;
34 }
230ac6e7
ER
35-#else
36- if (sapi_module.executable_location) {
37- binary_location = (char *)emalloc(PATH_MAX);
38- if (!realpath(sapi_module.executable_location, binary_location)) {
39- efree(binary_location);
40- binary_location = NULL;
41- }
42- } else {
43- binary_location = NULL;
44- }
45-#endif
32d8246b 46+
32d8246b
ER
47 if (binary_location) {
48 char *separator_location = strrchr(binary_location, DEFAULT_SLASH);
49
230ac6e7 50@@ -370,7 +360,6 @@
32d8246b
ER
51 }
52
53 /* Add default location */
54-#ifdef PHP_WIN32
55 default_location = (char *) emalloc(MAXPATHLEN + 1);
56
57 if (0 < GetWindowsDirectory(default_location, MAXPATHLEN)) {
This page took 0.038634 seconds and 4 git commands to generate.