char resolved_path[MAXPATHLEN];
if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */
- return 1;
+ if (use_realpath == 2) {
+ return 1;
+ }
+ goto no_realpath;
}
CWD_STATE_COPY(&old_state, state);
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 1)==0) {
+ if (virtual_file_ex(&new_state, path, NULL, 2)==0) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, 2)) {
return -1;
}
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, 1)) {
+ if (virtual_file_ex(&new_state, filename, NULL, 2)) {
return -1;
}
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ if (virtual_file_ex(&new_state, path, NULL, 2)) {
return -1;
}
DIR *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, 2)) {
return NULL;
}
new_state.cwd_length = 0;
}
- if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ if (virtual_file_ex(&new_state, path, NULL, 2)) {
free(new_state.cwd);
return NULL;
}