- Quick hackto make tests pass

# There is something missing, ZVAL_TYPED_ASCII_STRING(z, type, char*,flags)
# Or am i overseeinghow that works?
This commit is contained in:
Marcus Boerger 2006-12-20 23:30:23 +00:00
parent ddd8d7f3ef
commit ba2f82f2eb

View File

@ -1225,16 +1225,28 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type, v
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(readobj TSRMLS_CC);
if (type == IS_STRING) {
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
if (type == IS_STRING) {
ZVAL_STRINGL(writeobj, intern->file_name, intern->file_name_len, 1);
return SUCCESS;
case SPL_FS_DIR:
}
if (type == IS_UNICODE && UG(unicode)) {
ZVAL_ASCII_STRINGL(writeobj, intern->file_name, intern->file_name_len, 1);
return SUCCESS;
}
break;
case SPL_FS_DIR:
if (type == IS_STRING) {
ZVAL_STRING(writeobj, intern->u.dir.entry.d_name, 1);
return SUCCESS;
}
if (type == IS_UNICODE && UG(unicode)) {
ZVAL_ASCII_STRING(writeobj, intern->u.dir.entry.d_name, 1);
return SUCCESS;
}
break;
}
ZVAL_NULL(writeobj);
return FAILURE;