diff options
| author | Andi Gutmans <andi@php.net> | 2000-06-10 15:15:28 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2000-06-10 15:15:28 +0000 |
| commit | a1c036b8cf08aef7cb65b3a30cd406489e3e1b11 (patch) | |
| tree | 596aced0b4a97844f91444748719ddc3a79071c2 | |
| parent | 390dccacac73e465dfb51f4d77362ac92bbb42a9 (diff) | |
| download | php-git-a1c036b8cf08aef7cb65b3a30cd406489e3e1b11.tar.gz | |
- Fix bug in virtual_file_ex when the resulting path is the root.
| -rw-r--r-- | main/php_virtual_cwd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/php_virtual_cwd.c b/main/php_virtual_cwd.c index 03ba8f4b21..ca598536d6 100644 --- a/main/php_virtual_cwd.c +++ b/main/php_virtual_cwd.c @@ -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); |
