cvs: php4 /sapi/thttpd thttpd.c
| From: | Sascha Schumann | Date: | Sun, 27 Aug 2000 20:53:10 +0000 |
| Subject: | cvs: php4 /sapi/thttpd thttpd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1428@lists.php.net to get a copy of this message | ||
sas Sun Aug 27 13:53:10 2000 EDT
Modified files:
/php4/sapi/thttpd thttpd.c
Log:
Compute absolute path to script
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.20 php4/sapi/thttpd/thttpd.c:1.21
--- php4/sapi/thttpd/thttpd.c:1.20 Fri Aug 25 03:00:48 2000
+++ php4/sapi/thttpd/thttpd.c Sun Aug 27 13:53:10 2000
@@ -191,12 +191,18 @@
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;