1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 18:13:00 +02:00

- Fix bug in virtual_file_ex when the resulting path is the root.

This commit is contained in:
Andi Gutmans
2000-06-10 15:15:28 +00:00
parent 390dccacac
commit a1c036b8cf

View File

@@ -327,6 +327,13 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
ptr = php_strtok_r(NULL, TOKENIZER_STRING, &tok);
}
if (state->cwd_length == COPY_WHEN_ABSOLUTE) {
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
state->cwd[state->cwd_length] = DEFAULT_SLASH;
state->cwd[state->cwd_length+1] = '\0';
state->cwd_length++;
}
if (verify_path && verify_path(state)) {
CWD_STATE_FREE(state);