Changeset 661 for trunk/xcache.c
- Timestamp:
- 2009-08-03T09:37:21+02:00 (4 years ago)
- File:
-
- 1 edited
-
trunk/xcache.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache.c
r656 r661 814 814 int size = strlen(include_path) + 1; 815 815 char tokens[] = { DEFAULT_DIR_SEPARATOR, '\0' }; 816 int ret; 816 817 ALLOCA_FLAG(use_heap) 817 818 … … 820 821 821 822 for (path = php_strtok_r(paths, tokens, &tokbuf); path; path = php_strtok_r(NULL, tokens, &tokbuf)) { 822 if (snprintf(filepath, sizeof(filepath), "%s/%s", path, filename) >= MAXPATHLEN - 1) { 823 continue; 824 } 825 if (VCWD_STAT(filepath, pbuf) == 0) { 826 my_free_alloca(paths, use_heap); 827 return SUCCESS; 828 } 829 } 830 823 if (snprintf(filepath, sizeof(filepath), "%s/%s", path, filename) < MAXPATHLEN - 1) { 824 if (VCWD_STAT(filepath, pbuf) == 0) { 825 ret = SUCCESS; 826 goto finish; 827 } 828 } 829 } 830 831 /* fall back to current directory */ 832 if (zend_is_executing(TSRMLS_C)) { 833 char *path = zend_get_executed_filename(TSRMLS_C); 834 if (path && path[0] != '[') { 835 int len = strlen(path); 836 while ((--len >= 0) && !IS_SLASH(path[len])) { 837 /* skipped */ 838 } 839 if (len > 0 && len + strlen(filename) + 1 < MAXPATHLEN - 1) { 840 strcpy(filepath, path); 841 strcpy(filepath + len + 1, filename); 842 if (VCWD_STAT(filepath, pbuf) == 0) { 843 ret = SUCCESS; 844 goto finish; 845 } 846 } 847 } 848 } 849 850 ret = FAILURE; 851 852 finish: 831 853 my_free_alloca(paths, use_heap); 832 854 833 return FAILURE;855 return ret; 834 856 } 835 857 /* }}} */
Note: See TracChangeset
for help on using the changeset viewer.

