mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
- 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:
parent
ddd8d7f3ef
commit
ba2f82f2eb
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user