summaryrefslogtreecommitdiff
path: root/main/fopen_wrappers.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-07-25 16:50:07 +0000
committerPierre Joye <pajoye@php.net>2011-07-25 16:50:07 +0000
commita02d8cfa3398175f35c95da6d6acbd3b08823f06 (patch)
tree33fefa00b341b9b20f9a1062b604b7d8c7cec8aa /main/fopen_wrappers.c
parent48ec4ace5f5f279fe5f2a82a7ea2e1b82dda350d (diff)
downloadphp-git-a02d8cfa3398175f35c95da6d6acbd3b08823f06.tar.gz
- add expand_filepath_with_mode (not used anywhere yet but will be used for file ops (fopen&co) to avoid extra links resolution and other non required ops on open
Diffstat (limited to 'main/fopen_wrappers.c')
-rw-r--r--main/fopen_wrappers.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 812d591767..8766aaf893 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -741,6 +741,14 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC)
*/
PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len TSRMLS_DC)
{
+ return expand_filepath_with_mode(filepath, real_path, relative_to, relative_to_len, CWD_FILEPATH TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ expand_filepath_use_realpath
+ */
+PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode TSRMLS_DC)
+{
cwd_state new_state;
char cwd[MAXPATHLEN];
int copy_len;
@@ -785,7 +793,7 @@ PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const cha
new_state.cwd = strdup(cwd);
new_state.cwd_length = strlen(cwd);
- if (virtual_file_ex(&new_state, filepath, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, filepath, NULL, realpath_mode TSRMLS_CC)) {
free(new_state.cwd);
return NULL;
}