]> granicus.if.org Git - php/commitdiff
- Fix bug in virtual_file_ex when the resulting path is the root.
authorAndi Gutmans <andi@php.net>
Sat, 10 Jun 2000 15:15:28 +0000 (15:15 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 10 Jun 2000 15:15:28 +0000 (15:15 +0000)
main/php_virtual_cwd.c

index 03ba8f4b2115a40a931093c45227adeebc6b62a1..ca598536d663cc5148d1ae06e8086cde1fef707b 100644 (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);