From: Sascha Schumann Date: Sun, 27 Aug 2000 20:53:10 +0000 (+0000) Subject: Compute absolute path to script X-Git-Tag: php-4.0.2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b719aa462d08d8dd352e3ecb672b99e85993ed5;p=php Compute absolute path to script --- diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index d4249232d3..b0b0e71f0b 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -191,12 +191,18 @@ static sapi_module_struct sapi_module = { static void thttpd_module_main(TLS_D SLS_DC) { zend_file_handle file_handle; + char cwd[4096]; + char *filename; CLS_FETCH(); ELS_FETCH(); PLS_FETCH(); + V_GETCWD(cwd, sizeof(cwd)); + filename = alloca(strlen(cwd) + strlen(TG(hc)->expnfilename) + 2); + sprintf(filename, "%s%c%s", cwd, PHP_DIR_SEPARATOR, TG(hc)->expnfilename); /* SAFE */ + file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = TG(hc)->expnfilename; + file_handle.filename = filename; file_handle.free_filename = 0; file_handle.opened_path = NULL;