]> git.pld-linux.org Git - packages/php.git/blob - php-ini-search-path.patch
This commit was manufactured by cvs2git to create tag 'auto-ac-php-5_1_5-1'.
[packages/php.git] / php-ini-search-path.patch
1 see also http://bugs.php.net/bug.php?id=34793
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");
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) {
25 @@ -339,23 +340,12 @@
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);
33                         binary_location = NULL;
34                 }
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
46 +
47                 if (binary_location) {
48                         char *separator_location = strrchr(binary_location, DEFAULT_SLASH);
49                         
50 @@ -370,7 +360,6 @@
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.047942 seconds and 3 git commands to generate.