cvs: php4 /ext/bz2 bz2.c

From: Date: Tue, 14 Aug 2001 17:39:08 +0000
Subject: cvs: php4 /ext/bz2 bz2.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6844@lists.php.net to get a copy of this message
dbeu Tue Aug 14 13:39:08 2001 EDT Modified files: /php4/ext/bz2 bz2.c Log: nuke warnings + fix v-dir behaviour Index: php4/ext/bz2/bz2.c diff -u php4/ext/bz2/bz2.c:1.19 php4/ext/bz2/bz2.c:1.20 --- php4/ext/bz2/bz2.c:1.19 Tue Jul 31 01:43:47 2001 +++ php4/ext/bz2/bz2.c Tue Aug 14 13:39:08 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: bz2.c,v 1.19 2001/07/31 05:43:47 zeev Exp $ */ +/* $Id: bz2.c,v 1.20 2001/08/14 17:39:08 dbeu Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -104,6 +104,7 @@ **mode; /* The mode to open the stream with */ BZFILE *bz; /* The compressed file stream */ FILE *fp; /* If filepointer is given, its placed in here */ + char *path; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &file, &mode) == FAILURE) { @@ -114,7 +115,14 @@ /* If it's not a resource its a string containing the filename to open */ if (Z_TYPE_PP(file) != IS_RESOURCE) { convert_to_string_ex(file); - bz = BZ2_bzopen(Z_STRVAL_PP(file), Z_STRVAL_PP(mode)); + +#ifdef VIRTUAL_DIR + virtual_filepath(Z_STRVAL_PP(file), &path TSRMLS_CC); +#else + path = Z_STRVAL_PP(file); +#endif + + bz = BZ2_bzopen(path, Z_STRVAL_PP(mode)); } /* If it is a resource, than its a 'FILE *' resource */ else { @@ -406,13 +414,13 @@ RETURN_LONG(errnum); break; case PHP_BZ_ERRSTR: - RETURN_STRING(errstr, 1); + RETURN_STRING((char*)errstr, 1); break; case PHP_BZ_ERRBOTH: array_init(return_value); add_assoc_long (return_value, "errno", errnum); - add_assoc_string(return_value, "errstr", errstr, 1); + add_assoc_string(return_value, "errstr", (char*)errstr, 1); break; }

« previous php.cvs (#6844) next »