From: Sam Ruby Date: Thu, 30 Mar 2000 23:23:29 +0000 (+0000) Subject: eliminate chdir if it is already virtual X-Git-Tag: php-4.0RC2~557 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a94c8d598e274cab73453463760f221bf10e680;p=php eliminate chdir if it is already virtual --- diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c index 3546c61914..5cc680f91d 100644 --- a/sapi/servlet/servlet.c +++ b/sapi/servlet/servlet.c @@ -365,9 +365,16 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send * Parse the file */ SETSTRING( SG(request_info).path_translated, pathTranslated ); +#ifdef VIRTUAL_DIR + file_handle.handle.fp = php_fopen_primary_script(); +#else + // The java runtime doesn't like the working directory to be + // changed, so save it and change it back as quickly as possible + // in the hopes that Java doesn't notice. getcwd(cwd,MAXPATHLEN); file_handle.handle.fp = php_fopen_primary_script(); chdir(cwd); +#endif file_handle.filename = SG(request_info).path_translated; file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FP;