]> granicus.if.org Git - php/commitdiff
- Reverting Sascha's patch although I don't like doing these kind of things
authorAndi Gutmans <andi@php.net>
Sun, 27 Aug 2000 19:51:50 +0000 (19:51 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 27 Aug 2000 19:51:50 +0000 (19:51 +0000)
- but as it is Sascha who has reverted a zillion patches I don't feel that
- bad about it :)
- The patch is morally incorrect and it actually also has a crash bug which
- I won't point out because it shouldn't be there.
- SG(path_translated) should be set by the SAPI module correctly and if it
- isn't the SAPI module should be fixed and not add code to PHP. There is
- enough special case code in PHP and I would like to clean it up and not
- add more.
- Last but not least, old_cwd takes 4KB of stack space. We should probably
- malloc() it because in ISAPI we only have 10KB of stack space.

main/main.c

index 86c8634804f9b00952f663f9dcf41e9753029a43..e1d72551e5d113d1aa34d60e5398d51f48734ece 100644 (file)
@@ -1106,10 +1106,9 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
        zend_file_handle *prepend_file_p, *append_file_p;
        zend_file_handle prepend_file, append_file;
        char old_cwd[4096];
-       char new_path[4096];
        SLS_FETCH();
 
-       old_cwd[0] = new_path[0] = '\0';
+       old_cwd[0] = '\0';
        php_hash_environment(ELS_C SLS_CC PLS_CC);
 
        zend_activate_modules();
@@ -1149,13 +1148,6 @@ 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);
-               
-               if (!IS_ABSOLUTE_PATH(primary_file->filename, strlen(primary_file->filename))) {
-                       snprintf(new_path, sizeof(new_path), "%s%c%s", old_cwd, PHP_DIR_SEPARATOR, primary_file->filename);
-                       new_path[sizeof(new_path)-1] = '\0';
-                       primary_file->filename = new_path;
-               }
-               
                V_CHDIR_FILE(primary_file->filename);
        }