Browse Source

sizeof(old_cwd) evaluated to sizeof(char *) after last commit, so old_cwd

was not set correctly.
PHP-4.0.5
Sascha Schumann 26 years ago
parent
commit
e783d75ed3
  1. 6
      main/main.c

6
main/main.c

@ -1132,8 +1132,8 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
return;
}
}
old_cwd = do_alloca(4096);
#define OLD_CWD_SIZE 4096
old_cwd = do_alloca(OLD_CWD_SIZE);
old_cwd[0] = '\0';
if (setjmp(EG(bailout))!=0) {
@ -1149,7 +1149,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
if (primary_file->type == ZEND_HANDLE_FILENAME
&& primary_file->filename) {
V_GETCWD(old_cwd, sizeof(old_cwd)-1);
V_GETCWD(old_cwd, OLD_CWD_SIZE-1);
V_CHDIR_FILE(primary_file->filename);
}

Loading…
Cancel
Save