char resolved_path[MAXPATHLEN];
if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */
- if (use_realpath == 2) {
+ if (use_realpath == CWD_REALPATH) {
return 1;
}
goto no_realpath;
CWD_API int virtual_chdir(const char *path TSRMLS_DC)
{
- return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, 1)?-1:0;
+ return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0;
}
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC)
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 2)==0) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- retval = virtual_file_ex(&new_state, path, verify_path, 1);
+ retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH);
*filepath = new_state.cwd;
}
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
return NULL;
}
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, 2)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
return -1;
}
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, 0)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
return -1;
}
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, 2)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
return -1;
}
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, 0)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
return -1;
}
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
return -1;
}
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
return -1;
}
int retval;
CWD_STATE_COPY(&old_state, &CWDG(cwd));
- if (virtual_file_ex(&old_state, oldname, NULL, 0)) {
+ if (virtual_file_ex(&old_state, oldname, NULL, CWD_REALPATH)) {
return -1;
}
oldname = old_state.cwd;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, newname, NULL, 0)) {
+ if (virtual_file_ex(&new_state, newname, NULL, CWD_FILEPATH)) {
return -1;
}
newname = new_state.cwd;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 2)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
return -1;
}
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 0)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
return -1;
}
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 0)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
return -1;
}
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) {
return -1;
}
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, 0)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) {
return -1;
}
DIR *retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, 2)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
return NULL;
}
new_state.cwd_length = 0;
}
- if (virtual_file_ex(&new_state, path, NULL, 2)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
free(new_state.cwd);
return NULL;
}