[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_directory.h

2009-06-04 Thread Etienne Kneuss
colder  Thu Jun  4 14:46:26 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c spl_directory.h 
  Log:
  MFH: Include other flags as well
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.42r2=1.45.2.27.2.23.2.43diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.42 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.43
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.42 Sat May  9 21:06:58 2009
+++ php-src/ext/spl/spl_directory.c Thu Jun  4 14:46:26 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.42 2009/05/09 21:06:58 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.43 2009/06/04 14:46:26 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -1216,7 +1216,7 @@
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-   RETURN_LONG(intern-flags  (SPL_FILE_DIR_KEY_MODE_MASK | 
SPL_FILE_DIR_CURRENT_MODE_MASK));
+   RETURN_LONG(intern-flags  (SPL_FILE_DIR_KEY_MODE_MASK | 
SPL_FILE_DIR_CURRENT_MODE_MASK | SPL_FILE_DIR_OTHERS_MASK));
 } /* }}} */
 
 /* {{{ proto void FilesystemIterator::setFlags(long $flags)
@@ -1228,8 +1228,8 @@
 
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, flags);
 
-   intern-flags = 
~(SPL_FILE_DIR_KEY_MODE_MASK|SPL_FILE_DIR_CURRENT_MODE_MASK);
-   intern-flags |= 
((SPL_FILE_DIR_KEY_MODE_MASK|SPL_FILE_DIR_CURRENT_MODE_MASK)  flags);
+   intern-flags = 
~(SPL_FILE_DIR_KEY_MODE_MASK|SPL_FILE_DIR_CURRENT_MODE_MASK|SPL_FILE_DIR_OTHERS_MASK);
+   intern-flags |= 
((SPL_FILE_DIR_KEY_MODE_MASK|SPL_FILE_DIR_CURRENT_MODE_MASK|SPL_FILE_DIR_OTHERS_MASK)
  flags);
 } /* }}} */
 
 /* {{{ proto bool RecursiveDirectoryIterator::hasChildren([bool $allow_links = 
false])
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.12.2.5.2.4.2.13r2=1.12.2.5.2.4.2.14diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.13 
php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.14
--- php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.13   Wed Dec 31 11:15:43 2008
+++ php-src/ext/spl/spl_directory.h Thu Jun  4 14:46:26 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.h,v 1.12.2.5.2.4.2.13 2008/12/31 11:15:43 sebastian Exp 
$ */
+/* $Id: spl_directory.h,v 1.12.2.5.2.4.2.14 2009/06/04 14:46:26 colder Exp $ */
 
 #ifndef SPL_DIRECTORY_H
 #define SPL_DIRECTORY_H
@@ -134,6 +134,7 @@
 
 #define SPL_FILE_DIR_SKIPDOTS  0x1000 /* Tells whether it 
should skip dots or not */
 #define SPL_FILE_DIR_UNIXPATHS 0x2000 /* Whether to unixify 
path separators */
+#define SPL_FILE_DIR_OTHERS_MASK   0x3000 /* mask used for 
get/setFlags */
 
 #endif /* SPL_DIRECTORY_H */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2009-03-10 Thread Marcus Boerger
helly   Tue Mar 10 23:28:17 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - MFH Safer flag handling as requested by Greg
  http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.40r2=1.45.2.27.2.23.2.41diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.40 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.41
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.40 Wed Dec 31 11:15:43 2008
+++ php-src/ext/spl/spl_directory.c Tue Mar 10 23:28:17 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.40 2008/12/31 11:15:43 sebastian 
Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.41 2009/03/10 23:28:17 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -44,6 +44,8 @@
 #include ext/standard/basic_functions.h
 #include ext/standard/php_filestat.h
 
+#define SPL_HAS_FLAG(flags, test_flag) ((flags  test_flag) ? 1 : 0)
+
 /* declare the class handlers */
 static zend_object_handlers spl_filesystem_object_handlers;
 
@@ -175,7 +177,7 @@
 
 static inline void spl_filesystem_object_get_file_name(spl_filesystem_object 
*intern TSRMLS_DC) /* {{{ */
 {
-   char slash = intern-flags  SPL_FILE_DIR_UNIXPATHS ? '/' : 
DEFAULT_SLASH;
+   char slash = SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_UNIXPATHS) ? '/' 
: DEFAULT_SLASH;
 
if (!intern-file_name) {
switch (intern-type) {
@@ -215,7 +217,7 @@
 /* open a directory resource */
 static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path 
TSRMLS_DC)
 {
-   int skip_dots = intern-flags  SPL_FILE_DIR_SKIPDOTS;
+   int skip_dots = SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_SKIPDOTS);
 
intern-type = SPL_FS_DIR;
intern-_path_len = strlen(path);
@@ -314,7 +316,7 @@
case SPL_FS_DIR:
spl_filesystem_dir_open(intern, source-_path TSRMLS_CC);
/* read until we hit the position in which we were before */
-   skip_dots = source-flags  SPL_FILE_DIR_SKIPDOTS;
+   skip_dots = SPL_HAS_FLAG(source-flags, SPL_FILE_DIR_SKIPDOTS);
for(index = 0; index  source-u.dir.index; ++index) {
do {
spl_filesystem_dir_read(intern TSRMLS_CC);
@@ -600,7 +602,7 @@
 #define DIT_CTOR_FLAGS  0x0001
 #define DIT_CTOR_GLOB   0x0002
 
-void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, int 
ctor_flags) /* {{{ */
+void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, long 
ctor_flags) /* {{{ */
 {
spl_filesystem_object *intern;
char *path;
@@ -610,17 +612,17 @@
 
zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, 
error_handling TSRMLS_CC);
 
-   if (ctor_flags  DIT_CTOR_FLAGS) {
+   if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_FLAGS)) {
flags = 
SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
s|l, path, len, flags);
} else {
flags = 
SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, 
path, len);
}
-   if (ctor_flags  SPL_FILE_DIR_SKIPDOTS) {
+   if (SPL_HAS_FLAG(ctor_flags, SPL_FILE_DIR_SKIPDOTS)) {
flags |= SPL_FILE_DIR_SKIPDOTS;
}
-   if (ctor_flags  SPL_FILE_DIR_UNIXPATHS) {
+   if (SPL_HAS_FLAG(ctor_flags, SPL_FILE_DIR_UNIXPATHS)) {
flags |= SPL_FILE_DIR_UNIXPATHS;
}
if (parsed == FAILURE) {
@@ -635,7 +637,7 @@
 
intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() 
TSRMLS_CC);
intern-flags = flags;
-   if ((ctor_flags  DIT_CTOR_GLOB)  strstr(path, glob://) != path) {
+   if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB)  strstr(path, glob://) 
!= path) {
spprintf(path, 0, glob://%s, path);
spl_filesystem_dir_open(intern, path TSRMLS_CC);
efree(path);
@@ -698,7 +700,7 @@
 SPL_METHOD(DirectoryIterator, next)
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
-   int skip_dots = intern-flags  SPL_FILE_DIR_SKIPDOTS;
+   int skip_dots = SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_SKIPDOTS);
 
intern-u.dir.index++;
do {
@@ -1262,7 +1264,7 @@
zval zpath, zflags;
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
spl_filesystem_object *subdir;
-   char slash = intern-flags  SPL_FILE_DIR_UNIXPATHS ? '/' : 
DEFAULT_SLASH;
+   char slash = SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_UNIXPATHS) ? '/' 
: DEFAULT_SLASH;


[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c ZendEngine2 zend_closures.c zend_interfaces.c zend_interfaces.h

2008-12-22 Thread Etienne Kneuss
colder  Mon Dec 22 14:11:50 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2zend_closures.c zend_interfaces.c zend_interfaces.h 
/php-src/ext/splspl_directory.c 
  Log:
  MFH: Fix #46646 (Implement zend functions to restrict serialization or 
internal classes)
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_closures.c?r1=1.3.2.15r2=1.3.2.16diff_format=u
Index: ZendEngine2/zend_closures.c
diff -u ZendEngine2/zend_closures.c:1.3.2.15 
ZendEngine2/zend_closures.c:1.3.2.16
--- ZendEngine2/zend_closures.c:1.3.2.15Thu Nov 27 19:01:19 2008
+++ ZendEngine2/zend_closures.c Mon Dec 22 14:11:49 2008
@@ -17,11 +17,12 @@
+--+
 */
 
-/* $Id: zend_closures.c,v 1.3.2.15 2008/11/27 19:01:19 dmitry Exp $ */
+/* $Id: zend_closures.c,v 1.3.2.16 2008/12/22 14:11:49 colder Exp $ */
 
 #include zend.h
 #include zend_API.h
 #include zend_closures.h
+#include zend_interfaces.h
 #include zend_objects.h
 #include zend_objects_API.h
 #include zend_globals.h
@@ -79,20 +80,6 @@
 }
 /* }}} */
 
-static int zend_closure_serialize(zval *object, unsigned char **buffer, 
zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
-{
-   zend_error(E_RECOVERABLE_ERROR, Serialization of 'Closure' is not 
allowed);
-   return FAILURE;
-}
-/* }}} */
-
-static int zend_closure_unserialize(zval **object, zend_class_entry *ce, const 
unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) 
/* {{{ */
-{
-   zend_error(E_RECOVERABLE_ERROR, Unserialization of 'Closure' is not 
allowed);
-   return FAILURE;
-}
-/* }}} */
-
 static int zend_closure_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
 {
return (Z_OBJ_HANDLE_P(o1) != Z_OBJ_HANDLE_P(o2));
@@ -243,8 +230,8 @@
zend_ce_closure = zend_register_internal_class(ce TSRMLS_CC);
zend_ce_closure-ce_flags |= ZEND_ACC_FINAL_CLASS;
zend_ce_closure-create_object = zend_closure_new;
-   zend_ce_closure-serialize = zend_closure_serialize;
-   zend_ce_closure-unserialize = zend_closure_unserialize;
+   zend_ce_closure-serialize = zend_class_serialize_deny;
+   zend_ce_closure-unserialize = zend_class_unserialize_deny;
 
memcpy(closure_handlers, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers));
closure_handlers.get_constructor = zend_closure_get_constructor;
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_interfaces.c?r1=1.33.2.4.2.6.2.10r2=1.33.2.4.2.6.2.11diff_format=u
Index: ZendEngine2/zend_interfaces.c
diff -u ZendEngine2/zend_interfaces.c:1.33.2.4.2.6.2.10 
ZendEngine2/zend_interfaces.c:1.33.2.4.2.6.2.11
--- ZendEngine2/zend_interfaces.c:1.33.2.4.2.6.2.10 Thu Nov 27 19:01:19 2008
+++ ZendEngine2/zend_interfaces.c   Mon Dec 22 14:11:49 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zend_interfaces.c,v 1.33.2.4.2.6.2.10 2008/11/27 19:01:19 dmitry Exp $ 
*/
+/* $Id: zend_interfaces.c,v 1.33.2.4.2.6.2.11 2008/12/22 14:11:49 colder Exp $ 
*/
 
 #include zend.h
 #include zend_API.h
@@ -463,6 +463,21 @@
 }
 /* }}} */
 
+ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, 
zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+{
+   zend_class_entry *ce = Z_OBJCE_P(object);
+   zend_throw_exception_ex(NULL, 0 TSRMLS_CC, Serialization of '%s' is 
not allowed, ce-name);
+   return FAILURE;
+}
+/* }}} */
+
+ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, 
const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data 
TSRMLS_DC) /* {{{ */
+{
+   zend_throw_exception_ex(NULL, 0 TSRMLS_CC, Unserialization of '%s' is 
not allowed, ce-name);
+   return FAILURE;
+}
+/* }}} */
+
 /* {{{ zend_implement_serializable */
 static int zend_implement_serializable(zend_class_entry *interface, 
zend_class_entry *class_type TSRMLS_DC)
 {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_interfaces.h?r1=1.11.2.1.2.2.2.2r2=1.11.2.1.2.2.2.3diff_format=u
Index: ZendEngine2/zend_interfaces.h
diff -u ZendEngine2/zend_interfaces.h:1.11.2.1.2.2.2.2 
ZendEngine2/zend_interfaces.h:1.11.2.1.2.2.2.3
--- ZendEngine2/zend_interfaces.h:1.11.2.1.2.2.2.2  Sun Aug 24 18:22:33 2008
+++ ZendEngine2/zend_interfaces.h   Mon Dec 22 14:11:49 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zend_interfaces.h,v 1.11.2.1.2.2.2.2 2008/08/24 18:22:33 colder Exp $ 
*/
+/* $Id: zend_interfaces.h,v 1.11.2.1.2.2.2.3 2008/12/22 14:11:49 colder Exp $ 
*/
 
 #ifndef ZEND_INTERFACES_H
 #define ZEND_INTERFACES_H
@@ -64,6 +64,9 @@
 ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, 
zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
 ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const 
unsigned char *buf, zend_uint 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-11-05 Thread Etienne Kneuss
colder  Thu Nov  6 01:07:22 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  MFH: Fix #46421 (Take care about /)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.34r2=1.45.2.27.2.23.2.35diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.34 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.35
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.34 Sun Nov  2 21:19:36 2008
+++ php-src/ext/spl/spl_directory.c Thu Nov  6 01:07:22 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.34 2008/11/02 21:19:36 felipe Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.35 2008/11/06 01:07:22 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -221,7 +221,7 @@
intern-_path_len = strlen(path);
intern-u.dir.dirp = php_stream_opendir(path, 
ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
 
-   if (intern-_path_len  IS_SLASH_AT(path, intern-_path_len-1)) {
+   if (intern-_path_len  1  IS_SLASH_AT(path, intern-_path_len-1)) {
intern-_path = estrndup(path, --intern-_path_len);
} else {
intern-_path = estrndup(path, intern-_path_len);
@@ -258,7 +258,7 @@
zend_list_addref(Z_RESVAL_P(intern-u.file.zcontext));
}
 
-   if (intern-file_name_len  IS_SLASH_AT(intern-file_name, 
intern-file_name_len-1)) {
+   if (intern-file_name_len  1  IS_SLASH_AT(intern-file_name, 
intern-file_name_len-1)) {
intern-file_name_len--;
}
 
@@ -349,7 +349,7 @@
intern-file_name = use_copy ? estrndup(path, len) : path;
intern-file_name_len = len;
 
-   while(IS_SLASH_AT(intern-file_name, intern-file_name_len-1)) {
+   while(IS_SLASH_AT(intern-file_name, intern-file_name_len-1)  
intern-file_name_len  1) {
intern-file_name[intern-file_name_len-1] = 0;
intern-file_name_len--;
}
@@ -1965,7 +1965,7 @@
if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == 
SUCCESS) {
tmp_path_len = strlen(intern-u.file.stream-orig_path);
 
-   if (tmp_path_len  
IS_SLASH_AT(intern-u.file.stream-orig_path, tmp_path_len-1)) {
+   if (tmp_path_len  1  
IS_SLASH_AT(intern-u.file.stream-orig_path, tmp_path_len-1)) {
tmp_path_len--;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_iterators.c

2008-10-21 Thread Arnaud Le Blanc
lbarnaudTue Oct 21 22:08:20 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c spl_iterators.c 
  Log:
  initialize optional vars
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.31r2=1.45.2.27.2.23.2.32diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.31 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.32
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.31 Thu Sep 11 15:31:58 2008
+++ php-src/ext/spl/spl_directory.c Tue Oct 21 22:08:20 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.31 2008/09/11 15:31:58 lbarnaud Exp 
$ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.32 2008/10/21 22:08:20 lbarnaud Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -2186,8 +2186,8 @@
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char delimiter = intern-u.file.delimiter, enclosure = 
intern-u.file.enclosure, escape = intern-u.file.escape;
-   char *delim, *enclo, *esc;
-   int d_len, e_len, esc_len;
+   char *delim = NULL, *enclo = NULL, *esc = NULL;
+   int d_len = 0, e_len = 0, esc_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sss, delim, 
d_len, enclo, e_len, esc, esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
@@ -2227,8 +2227,8 @@
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char delimiter = ',', enclosure = '', escape='\\';
-   char *delim, *enclo, *esc;
-   int d_len, e_len, esc_len;
+   char *delim = NULL, *enclo = NULL, *esc = NULL;
+   int d_len = 0, e_len = 0, esc_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sss, delim, 
d_len, enclo, e_len, esc, esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.28.2.15r2=1.73.2.30.2.28.2.16diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.15 
php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.16
--- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.15 Mon Sep 22 13:09:09 2008
+++ php-src/ext/spl/spl_iterators.c Tue Oct 21 22:08:20 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.15 2008/09/22 13:09:09 felipe Exp $ 
*/
+/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.16 2008/10/21 22:08:20 lbarnaud Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -1287,8 +1287,8 @@
}
case DIT_IteratorIterator: {
zend_class_entry **pce_cast;
-   char * class_name;
-   int class_name_len;
+   char * class_name = NULL;
+   int class_name_len = 0;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
O|s, zobject, ce_inner, class_name, class_name_len) == FAILURE) {
return NULL;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_directory.h

2008-07-24 Thread Steph Fox
sfoxThu Jul 24 08:55:53 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c spl_directory.h 
  Log:
  MFH SPL_FILE_DIR_UNIXPATHS.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.26r2=1.45.2.27.2.23.2.27diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.26 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.27
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.26 Wed Jul 23 06:12:29 2008
+++ php-src/ext/spl/spl_directory.c Thu Jul 24 08:55:52 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.26 2008/07/23 06:12:29 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.27 2008/07/24 08:55:52 sfox Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -175,6 +175,8 @@
 
 static inline void spl_filesystem_object_get_file_name(spl_filesystem_object 
*intern TSRMLS_DC) /* {{{ */
 {
+   char slash = intern-flags  SPL_FILE_DIR_UNIXPATHS ? '/' : 
DEFAULT_SLASH;
+
if (!intern-file_name) {
switch (intern-type) {
case SPL_FS_INFO:
@@ -184,7 +186,7 @@
case SPL_FS_DIR:
intern-file_name_len = spprintf(intern-file_name, 0, 
%s%c%s,
 
spl_filesystem_object_get_path(intern, NULL TSRMLS_CC),
-DEFAULT_SLASH, 
intern-u.dir.entry.d_name);
+slash, 
intern-u.dir.entry.d_name);
break;
}
}
@@ -615,6 +617,9 @@
if (ctor_flags  SPL_FILE_DIR_SKIPDOTS) {
flags |= SPL_FILE_DIR_SKIPDOTS;
}
+   if (ctor_flags  SPL_FILE_DIR_UNIXPATHS) {
+   flags |= SPL_FILE_DIR_UNIXPATHS;
+   }
if (parsed == FAILURE) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
return;
@@ -1244,6 +1249,7 @@
zval zpath, zflags;
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
spl_filesystem_object *subdir;
+   char slash = intern-flags  SPL_FILE_DIR_UNIXPATHS ? '/' : 
DEFAULT_SLASH;

spl_filesystem_object_get_file_name(intern TSRMLS_CC);
 
@@ -1257,7 +1263,7 @@
subdir = 
(spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC);
if (subdir) {
if (intern-u.dir.sub_path  intern-u.dir.sub_path[0]) {
-   subdir-u.dir.sub_path_len = 
spprintf(subdir-u.dir.sub_path, 0, %s%c%s, intern-u.dir.sub_path, 
DEFAULT_SLASH, intern-u.dir.entry.d_name);
+   subdir-u.dir.sub_path_len = 
spprintf(subdir-u.dir.sub_path, 0, %s%c%s, intern-u.dir.sub_path, slash, 
intern-u.dir.entry.d_name);
} else {
subdir-u.dir.sub_path_len = 
strlen(intern-u.dir.entry.d_name);
subdir-u.dir.sub_path = 
estrndup(intern-u.dir.entry.d_name, subdir-u.dir.sub_path_len);
@@ -1290,9 +1296,10 @@
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char *sub_name;
int len;
+   char slash = intern-flags  SPL_FILE_DIR_UNIXPATHS ? '/' : 
DEFAULT_SLASH;
 
if (intern-u.dir.sub_path) {
-   len = spprintf(sub_name, 0, %s%c%s, intern-u.dir.sub_path, 
DEFAULT_SLASH, intern-u.dir.entry.d_name);
+   len = spprintf(sub_name, 0, %s%c%s, intern-u.dir.sub_path, 
slash, intern-u.dir.entry.d_name);
RETURN_STRINGL(sub_name, len, 0);
} else {
RETURN_STRING(intern-u.dir.entry.d_name, 1);
@@ -2624,6 +2631,7 @@
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, KEY_AS_FILENAME,
 SPL_FILE_DIR_KEY_AS_FILENAME);
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, 
NEW_CURRENT_AND_KEY, 
SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO);
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, SKIP_DOTS,  
 SPL_FILE_DIR_SKIPDOTS);
+   REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, UNIX_PATHS, 
 SPL_FILE_DIR_UNIXPATHS);
 
spl_ce_FilesystemIterator-get_iterator = 
spl_filesystem_tree_get_iterator;
 
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.12.2.5.2.4.2.11r2=1.12.2.5.2.4.2.12diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.11 
php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.12
--- php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.11   Sat Jul 19 11:20:18 2008
+++ php-src/ext/spl/spl_directory.h Thu Jul 24 08:55:52 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.h,v 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-07-23 Thread Marcus Boerger
helly   Wed Jul 23 06:12:29 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - [DOC] Add FilesystemIterator::SKIP_DOTS (flag to skip '.' and '..' in 
iteration)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.25r2=1.45.2.27.2.23.2.26diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.25 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.26
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.25 Sat Jul 19 11:20:18 2008
+++ php-src/ext/spl/spl_directory.c Wed Jul 23 06:12:29 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.25 2008/07/19 11:20:18 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.26 2008/07/23 06:12:29 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -2623,6 +2623,7 @@
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, KEY_AS_PATHNAME,
 SPL_FILE_DIR_KEY_AS_PATHNAME);
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, KEY_AS_FILENAME,
 SPL_FILE_DIR_KEY_AS_FILENAME);
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, 
NEW_CURRENT_AND_KEY, 
SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO);
+   REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, SKIP_DOTS,  
 SPL_FILE_DIR_SKIPDOTS);
 
spl_ce_FilesystemIterator-get_iterator = 
spl_filesystem_tree_get_iterator;
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-07-23 Thread Hannes Magnusson
2008/7/23 Marcus Boerger [EMAIL PROTECTED]:
 helly   Wed Jul 23 06:12:29 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c
  Log:
  - [DOC] Add FilesystemIterator::SKIP_DOTS (flag to skip '.' and '..' in 
 iteration)

SKIP_DOTS to me sounds like it will skip all hidden files/folders,
not . and ..

Don't these dot dirs have some special name which the flag could be named after?

-Hannes

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-07-23 Thread Marcus Boerger
Hello Hannes,

Wednesday, July 23, 2008, 8:36:22 AM, you wrote:

 2008/7/23 Marcus Boerger [EMAIL PROTECTED]:
 helly   Wed Jul 23 06:12:29 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c
  Log:
  - [DOC] Add FilesystemIterator::SKIP_DOTS (flag to skip '.' and '..' in 
 iteration)

 SKIP_DOTS to me sounds like it will skip all hidden files/folders,
 not . and ..

 Don't these dot dirs have some special name which the flag could be named 
 after?

I am not aware of any. But feel free to rename that constant to whatever
you see fit.

Best regards,
 Marcus


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_directory.h /ext/spl/tests dit_006.phpt

2008-07-19 Thread Etienne Kneuss
colder  Sat Jul 19 11:20:18 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  dit_006.phpt 

  Modified files:  
/php-src/ext/splspl_directory.c spl_directory.h 
  Log:
  MFH: Implement DirectoryIterator::seek
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.24r2=1.45.2.27.2.23.2.25diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.24 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.25
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.24 Tue Jul  8 22:40:48 2008
+++ php-src/ext/spl/spl_directory.c Sat Jul 19 11:20:18 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.24 2008/07/08 22:40:48 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.25 2008/07/19 11:20:18 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -703,6 +703,43 @@
 }
 /* }}} */
 
+/* {{{ proto void DirectoryIterator::seek(int position)
+   Seek to the given position */
+SPL_METHOD(DirectoryIterator, seek)
+{
+   spl_filesystem_object *intern= 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+   zval  *retval= NULL;
+   long   pos;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, pos) == 
FAILURE) {
+   return;
+   }
+
+   if (intern-u.dir.index  pos) {
+   /* we first rewind */
+   zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), 
intern-u.dir.func_rewind, rewind, retval);
+   if (retval) {
+   zval_ptr_dtor(retval);
+   }
+   }
+
+   while (intern-u.dir.index  pos) {
+   int valid = 0;
+   zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), 
intern-u.dir.func_valid, valid, retval);
+   if (retval) {
+   valid = zend_is_true(retval);
+   zval_ptr_dtor(retval);
+   }
+   if (!valid) {
+   break;
+   }
+   zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), 
intern-u.dir.func_next, next, retval);
+   if (retval) {
+   zval_ptr_dtor(retval);
+   }
+   }
+} /* }}} */
+
 /* {{{ proto string DirectoryIterator::valid()
Check whether dir contains more entries */
 SPL_METHOD(DirectoryIterator, valid)
@@ -1619,6 +1656,11 @@
ZEND_ARG_INFO(0, path)
 ZEND_END_ARG_INFO()
 
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dir_it_seek, 0) 
+   ZEND_ARG_INFO(0, position)
+ZEND_END_ARG_INFO();
+
 /* the method table */
 /* each method can have its own parameters and visibility */
 static const zend_function_entry spl_DirectoryIterator_functions[] = {
@@ -1631,6 +1673,7 @@
SPL_ME(DirectoryIterator, key,   NULL, ZEND_ACC_PUBLIC)
SPL_ME(DirectoryIterator, current,   NULL, ZEND_ACC_PUBLIC)
SPL_ME(DirectoryIterator, next,  NULL, ZEND_ACC_PUBLIC)
+   SPL_ME(DirectoryIterator, seek,  arginfo_dir_it_seek, 
ZEND_ACC_PUBLIC)
SPL_MA(DirectoryIterator, __toString, DirectoryIterator, getFilename, 
NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
 };
@@ -2560,12 +2603,13 @@
 {
REGISTER_SPL_STD_CLASS_EX(SplFileInfo, spl_filesystem_object_new, 
spl_SplFileInfo_functions);
memcpy(spl_filesystem_object_handlers, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers));
-   spl_filesystem_object_handlers.clone_obj = spl_filesystem_object_clone;
-   spl_filesystem_object_handlers.cast_object = spl_filesystem_object_cast;
-   spl_filesystem_object_handlers.get_debug_info = 
spl_filesystem_object_get_debug_info;
+   spl_filesystem_object_handlers.clone_obj   = 
spl_filesystem_object_clone;
+   spl_filesystem_object_handlers.cast_object = 
spl_filesystem_object_cast;
+   spl_filesystem_object_handlers.get_debug_info  = 
spl_filesystem_object_get_debug_info;
 
REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, 
spl_filesystem_object_new, spl_DirectoryIterator_functions);
zend_class_implements(spl_ce_DirectoryIterator TSRMLS_CC, 1, 
zend_ce_iterator);
+   REGISTER_SPL_IMPLEMENTS(DirectoryIterator, SeekableIterator);
 
spl_ce_DirectoryIterator-get_iterator = 
spl_filesystem_dir_get_iterator;
 
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.12.2.5.2.4.2.10r2=1.12.2.5.2.4.2.11diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.10 
php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.11
--- php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.10   Tue May 20 21:46:50 2008
+++ php-src/ext/spl/spl_directory.h Sat Jul 19 11:20:18 2008
@@ -16,7 +16,7 @@

Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c /ext/spl/tests dit_001.phpt fileobject_003.phpt fileobject_getfileinfo_basic.phpt

2008-07-09 Thread Dmitry Stogov
Hi Etienne,

After this patch I see 4 broken tests in ext/phar.
I'm not sure if the new behavior is expected, could you please take a look.

Thanks. Dmitry.

Etienne Kneuss wrote:
 colderTue Jul  8 22:40:49 2008 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/spl  spl_directory.c 
 /php-src/ext/spl/testsdit_001.phpt fileobject_003.phpt 
   fileobject_getfileinfo_basic.phpt 
   Log:
   MFH: - Fix filename in debug_info
   - Fix #45345 (getPathInfo on the file instead of the dir)
   - Remove trailing / on input
   
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c /ext/spl/tests dit_001.phpt fileobject_003.phpt fileobject_getfileinfo_basic.phpt

2008-07-08 Thread Etienne Kneuss
colder  Tue Jul  8 22:40:49 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
/php-src/ext/spl/tests  dit_001.phpt fileobject_003.phpt 
fileobject_getfileinfo_basic.phpt 
  Log:
  MFH: - Fix filename in debug_info
  - Fix #45345 (getPathInfo on the file instead of the dir)
  - Remove trailing / on input
  http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.23r2=1.45.2.27.2.23.2.24diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.23 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.24
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.23 Wed Jul  2 10:47:11 2008
+++ php-src/ext/spl/spl_directory.c Tue Jul  8 22:40:48 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.23 2008/07/02 10:47:11 tony2001 Exp 
$ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.24 2008/07/08 22:40:48 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -347,17 +347,23 @@
intern-file_name = use_copy ? estrndup(path, len) : path;
intern-file_name_len = len;
 
-   p1 = strrchr(path, '/');
+   while(IS_SLASH_AT(intern-file_name, intern-file_name_len-1)) {
+   intern-file_name[intern-file_name_len-1] = 0;
+   intern-file_name_len--;
+   }
+
+   p1 = strrchr(intern-file_name, '/');
 #if defined(PHP_WIN32) || defined(NETWARE)
-   p2 = strrchr(path, '\\');
+   p2 = strrchr(intern-file_name, '\\');
 #else
p2 = 0;
 #endif
if (p1 || p2) {
-   intern-_path_len = (p1  p2 ? p1 : p2) - path;
+   intern-_path_len = (p1  p2 ? p1 : p2) - intern-file_name;
} else {
intern-_path_len = 0;
}
+
intern-_path = estrndup(path, intern-_path_len);
 } /* }}} */
 
@@ -499,7 +505,25 @@
 }
 /* }}} */
 
-static HashTable* spl_filesystem_object_get_debug_info(zval *obj, int *is_temp 
TSRMLS_DC) /*  */
+static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, 
int *len TSRMLS_DC) { /* {{{ */
+   switch (intern-type) {
+   case SPL_FS_INFO:
+   case SPL_FS_FILE:
+   *len = intern-file_name_len;
+   return intern-file_name;
+   case SPL_FS_DIR:
+   if (intern-u.dir.entry.d_name[0]) {
+   spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+   *len = intern-file_name_len;
+   return intern-file_name;
+   }
+   }
+   *len = 0;
+   return NULL;
+}
+/* }}} */
+
+static HashTable* spl_filesystem_object_get_debug_info(zval *obj, int *is_temp 
TSRMLS_DC) /* {{{ */
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(obj TSRMLS_CC);
HashTable *rv;
@@ -518,13 +542,20 @@
 
zend_hash_copy(rv, intern-std.properties, (copy_ctor_func_t) 
zval_add_ref, (void *) tmp, sizeof(zval *));
 
-   path = spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, pathName, 
sizeof(pathName)-1, pnlen TSRMLS_CC);
+   path = spl_filesystem_object_get_pathname(intern, path_len TSRMLS_CC);
add_assoc_stringl_ex(zrv, pnstr, pnlen+1, path, path_len, 1);
efree(pnstr);
+
if (intern-file_name) {
pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, 
fileName, sizeof(fileName)-1, pnlen TSRMLS_CC);
-   add_assoc_stringl_ex(zrv, pnstr, pnlen+1, intern-file_name, 
intern-file_name_len, 1);
+   spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
+   
+   if (path_len  path_len  intern-file_name_len) {
+   add_assoc_stringl_ex(zrv, pnstr, pnlen+1, 
intern-file_name + path_len + 1, intern-file_name_len - (path_len + 1), 1);
+   } else {
+   add_assoc_stringl_ex(zrv, pnstr, pnlen+1, 
intern-file_name, intern-file_name_len, 1);
+   }
efree(pnstr);
}
if (intern-type == SPL_FS_DIR) {
@@ -560,7 +591,7 @@
 
return rv;
 }
-/*  */
+/* }}} */
 
 #define DIT_CTOR_FLAGS  0x0001
 #define DIT_CTOR_GLOB   0x0002
@@ -775,18 +806,14 @@
 SPL_METHOD(SplFileInfo, getPathname)
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
-
-   switch (intern-type) {
-   case SPL_FS_INFO:
-   case SPL_FS_FILE:
-   RETURN_STRINGL(intern-file_name, intern-file_name_len, 1);
-   case SPL_FS_DIR:
-   if (intern-u.dir.entry.d_name[0]) {
-   spl_filesystem_object_get_file_name(intern TSRMLS_CC);
-   RETURN_STRINGL(intern-file_name, 
intern-file_name_len, 1);
-  

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-07-02 Thread Antony Dovgal
tony2001Wed Jul  2 10:47:12 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  MFH: check return value of hash_find()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.22r2=1.45.2.27.2.23.2.23diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.22 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.23
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.22 Wed Jun 18 10:05:29 2008
+++ php-src/ext/spl/spl_directory.c Wed Jul  2 10:47:11 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.22 2008/06/18 10:05:29 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.23 2008/07/02 10:47:11 tony2001 Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -1746,7 +1746,12 @@
 #define FileFunctionCall(func_name, pass_num_args, arg2) /* {{{ */ \
 { \
zend_function *func_ptr; \
-   zend_hash_find(EG(function_table), #func_name, sizeof(#func_name), 
(void **) func_ptr); \
+   int ret; \
+   ret = zend_hash_find(EG(function_table), #func_name, 
sizeof(#func_name), (void **) func_ptr); \
+   if (ret != SUCCESS) { \
+   zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, 
Internal error, function '%s' not found. Please report, #func_name); \
+   return; \
+   } \
spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, 
arg2 TSRMLS_CC); \
 } /* }}} */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c /ext/spl/tests bug45216.phpt

2008-06-18 Thread Etienne Kneuss
colder  Wed Jun 18 10:05:29 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  bug45216.phpt 

  Modified files:  
/php-src/ext/splspl_directory.c 
  Log:
  MFH: Fix #45216 (Add a default size for fgetss)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.21r2=1.45.2.27.2.23.2.22diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.21 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.22
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.21 Tue May 20 21:46:50 2008
+++ php-src/ext/spl/spl_directory.c Wed Jun 18 10:05:29 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.21 2008/05/20 21:46:50 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.22 2008/06/18 10:05:29 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -2295,7 +2295,12 @@
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
zval *arg2 = NULL;
MAKE_STD_ZVAL(arg2);
-   ZVAL_LONG(arg2, intern-u.file.max_line_len);
+
+   if (intern-u.file.max_line_len  0) {
+   ZVAL_LONG(arg2, intern-u.file.max_line_len);
+   } else {
+   ZVAL_LONG(arg2, 1024);
+   }
 
spl_filesystem_file_free_line(intern TSRMLS_CC);
intern-u.file.current_line_num++;

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug45216.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/bug45216.phpt
+++ php-src/ext/spl/tests/bug45216.phpt
--TEST--
SPL: SplFileObject::fgetss (bug 45216)
--CREDITS--
Perrick Penet [EMAIL PROTECTED]
#testfest phpcampparis 2008-06-07
--FILE--
?php 
$file = dirname(__FILE__) . '/foo.html';
file_put_contents($file, 'text 0div class=testedtext 1/div');
$handle = fopen($file, 'r');

$object = new SplFileObject($file);
var_dump($object-fgetss());
var_dump(fgetss($handle));
?
--CLEAN--
?php
unlink(dirname(__FILE__) . '/foo.html');
?
--EXPECTF--
string(12) text 0text 1
string(12) text 0text 1



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_directory.h /ext/spl/tests fileobject_004.phpt

2008-05-20 Thread Etienne Kneuss
colder  Tue May 20 21:46:51 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  fileobject_004.phpt 

  Modified files:  
/php-src/ext/splspl_directory.c spl_directory.h 
  Log:
  MFH: Fix path lookup when include_path is used
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.20r2=1.45.2.27.2.23.2.21diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.20 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.21
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.20 Sun May 18 12:17:43 2008
+++ php-src/ext/spl/spl_directory.c Tue May 20 21:46:50 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.20 2008/05/18 12:17:43 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.21 2008/05/20 21:46:50 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -109,6 +109,9 @@
if (intern-u.file.open_mode) {
efree(intern-u.file.open_mode);
}
+   if (intern-orig_path) {
+   efree(intern-orig_path);
+   }
}
spl_filesystem_file_free_line(intern TSRMLS_CC);
break;
@@ -257,6 +260,8 @@
intern-file_name_len--;
}
 
+   intern-orig_path = estrndup(intern-u.file.stream-orig_path, 
strlen(intern-u.file.stream-orig_path));
+
intern-file_name = estrndup(intern-file_name, intern-file_name_len);
intern-u.file.open_mode = estrndup(intern-u.file.open_mode, 
intern-u.file.open_mode_len);
 
@@ -985,14 +990,22 @@
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char buff[MAXPATHLEN];
+   char *filename;
 
php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
if (intern-type == SPL_FS_DIR  !intern-file_name  
intern-u.dir.entry.d_name[0]) {
spl_filesystem_object_get_file_name(intern TSRMLS_CC);
}
+   
+   if (intern-orig_path) {
+   filename = intern-orig_path;
+   } else { 
+   filename = intern-file_name;
+   }
+
 
-   if (intern-file_name  VCWD_REALPATH(intern-file_name, buff)) {
+   if (filename  VCWD_REALPATH(filename, buff)) {
 #ifdef ZTS
if (VCWD_ACCESS(buff, F_OK)) {
RETVAL_FALSE;
@@ -1866,6 +1879,8 @@
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
zend_bool use_include_path = 0;
char *p1, *p2;
+   char *tmp_path;
+   int   tmp_path_len;
 
php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
@@ -1881,18 +1896,29 @@
}

if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == 
SUCCESS) {
-   p1 = strrchr(intern-file_name, '/');
+   tmp_path_len = strlen(intern-u.file.stream-orig_path);
+
+   if (tmp_path_len  
IS_SLASH_AT(intern-u.file.stream-orig_path, tmp_path_len-1)) {
+   tmp_path_len--;
+   }
+
+   tmp_path = estrndup(intern-u.file.stream-orig_path, 
tmp_path_len);
+
+   p1 = strrchr(tmp_path, '/');
 #if defined(PHP_WIN32) || defined(NETWARE)
-   p2 = strrchr(intern-file_name, '\\');
+   p2 = strrchr(tmp_path, '\\');
 #else
p2 = 0;
 #endif
if (p1 || p2) {
-   intern-_path_len = (p1  p2 ? p1 : p2) - 
intern-file_name;
+   intern-_path_len = (p1  p2 ? p1 : p2) - tmp_path;
} else {
intern-_path_len = 0;
}
-   intern-_path = estrndup(intern-file_name, intern-_path_len);
+
+   efree(tmp_path);
+
+   intern-_path = estrndup(intern-u.file.stream-orig_path, 
intern-_path_len);
}
 
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.12.2.5.2.4.2.9r2=1.12.2.5.2.4.2.10diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.9 
php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.10
--- php-src/ext/spl/spl_directory.h:1.12.2.5.2.4.2.9Sun May 18 12:17:43 2008
+++ php-src/ext/spl/spl_directory.h Tue May 20 21:46:50 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.h,v 1.12.2.5.2.4.2.9 2008/05/18 12:17:43 colder Exp $ */
+/* $Id: spl_directory.h,v 1.12.2.5.2.4.2.10 2008/05/20 21:46:50 colder Exp $ */
 
 #ifndef SPL_DIRECTORY_H
 #define SPL_DIRECTORY_H
@@ -65,6 +65,7 @@

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_directory.h /ext/spl/tests dit_004.phpt dit_005.phpt

2008-05-18 Thread Etienne Kneuss
colder  Sun May 18 12:17:43 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  dit_004.phpt dit_005.phpt 

  Modified files:  
/php-src/ext/splspl_directory.c spl_directory.h 
  Log:
  MFH: Fix filesystemiterator with ./.. + add cloning tests
  http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.19r2=1.45.2.27.2.23.2.20diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.19 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.20
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.19 Wed Apr  9 19:01:12 2008
+++ php-src/ext/spl/spl_directory.c Sun May 18 12:17:43 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.19 2008/04/09 19:01:12 colder Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.20 2008/05/18 12:17:43 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -200,10 +200,18 @@
 
 #define IS_SLASH_AT(zs, pos) (IS_SLASH(zs[pos]))
 
+static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */
+{
+   return !strcmp(d_name, .) || !strcmp(d_name, ..);
+}
+/* }}} */
+
 /* {{{ spl_filesystem_dir_open */
 /* open a directory resource */
 static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path 
TSRMLS_DC)
 {
+   int skip_dots = intern-flags  SPL_FILE_DIR_SKIPDOTS;
+
intern-type = SPL_FS_DIR;
intern-_path_len = strlen(path);
intern-u.dir.dirp = php_stream_opendir(path, 
ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
@@ -219,7 +227,9 @@
/* throw exception: should've been already happened */
intern-u.dir.entry.d_name[0] = '\0';
} else {
-   spl_filesystem_dir_read(intern TSRMLS_CC);
+   do {
+   spl_filesystem_dir_read(intern TSRMLS_CC);
+   } while (skip_dots  
spl_filesystem_is_dot(intern-u.dir.entry.d_name));
}
 }
 /* }}} */
@@ -277,6 +287,7 @@
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
spl_filesystem_object *intern;
spl_filesystem_object *source;
+   int index, skip_dots;
 
old_object = zend_objects_get_address(zobject TSRMLS_CC);
source = (spl_filesystem_object*)old_object;
@@ -284,6 +295,8 @@
new_obj_val = spl_filesystem_object_new_ex(old_object-ce, intern 
TSRMLS_CC);
new_object = intern-std;
 
+   intern-flags = source-flags;
+
switch (source-type) {
case SPL_FS_INFO:
intern-_path_len = source-_path_len;
@@ -293,6 +306,14 @@
break;
case SPL_FS_DIR:
spl_filesystem_dir_open(intern, source-_path TSRMLS_CC);
+   /* read until we hit the position in which we were before */
+   skip_dots = source-flags  SPL_FILE_DIR_SKIPDOTS;
+   for(index = 0; index  source-u.dir.index; ++index) {
+   do {
+   spl_filesystem_dir_read(intern TSRMLS_CC);
+   } while (skip_dots  
spl_filesystem_is_dot(intern-u.dir.entry.d_name));
+   }
+   intern-u.dir.index = index;
break;
case SPL_FS_FILE:
php_error_docref(NULL TSRMLS_CC, E_ERROR, An object of class 
%s cannot be cloned, old_object-ce-name);
@@ -301,7 +322,6 @@

intern-file_class = source-file_class;
intern-info_class = source-info_class;
-   intern-flags = source-flags;
intern-oth = source-oth;
intern-oth_handler = source-oth_handler;
 
@@ -468,12 +488,6 @@
return NULL;
 } /* }}} */
 
-static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */
-{
-   return !strcmp(d_name, .) || !strcmp(d_name, ..);
-}
-/* }}} */
-
 static int spl_filesystem_is_invalid_or_dot(const char * d_name) /* {{{ */
 {
return d_name[0] == '\0' || spl_filesystem_is_dot(d_name);
@@ -562,6 +576,9 @@
flags = 
SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, 
path, len);
}
+   if (ctor_flags  SPL_FILE_DIR_SKIPDOTS) {
+   flags |= SPL_FILE_DIR_SKIPDOTS;
+   }
if (parsed == FAILURE) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
return;
@@ -573,6 +590,7 @@
}
 
intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() 
TSRMLS_CC);
+   intern-flags = flags;
if ((ctor_flags  DIT_CTOR_GLOB)  strstr(path, glob://) != path) {
spprintf(path, 0, glob://%s, path);
spl_filesystem_dir_open(intern, path TSRMLS_CC);
@@ -582,7 +600,6 @@
}
 
intern-u.dir.is_recursive = instanceof_function(intern-std.ce, 
spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-04-09 Thread Etienne Kneuss
colder  Wed Apr  9 19:01:13 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  MFH: Fix #44511 (Ensure no exception was already thrown by php_stream_opendir)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.18r2=1.45.2.27.2.23.2.19diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.18 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.19
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.18 Thu Mar 13 19:46:44 2008
+++ php-src/ext/spl/spl_directory.c Wed Apr  9 19:01:12 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.18 2008/03/13 19:46:44 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.19 2008/04/09 19:01:12 colder Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -215,7 +215,7 @@
}
intern-u.dir.index = 0;
 
-   if (intern-u.dir.dirp == NULL) {
+   if (EG(exception) || intern-u.dir.dirp == NULL) {
/* throw exception: should've been already happened */
intern-u.dir.entry.d_name[0] = '\0';
} else {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c /ext/spl/tests dit_003.phpt

2008-03-13 Thread Marcus Boerger
helly   Thu Mar 13 19:46:44 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  dit_003.phpt 

  Modified files:  
/php-src/ext/splspl_directory.c 
  Log:
  - MFH Fix possible memory corruption
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.17r2=1.45.2.27.2.23.2.18diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.17 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.18
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.17 Wed Feb 13 12:05:34 2008
+++ php-src/ext/spl/spl_directory.c Thu Mar 13 19:46:44 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.17 2008/02/13 12:05:34 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.18 2008/03/13 19:46:44 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -1293,10 +1293,11 @@
 static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
 {
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
+   zval *zfree = (zval*)iterator-intern.data;
 
-   zval_ptr_dtor(iterator-current);
-   zval_ptr_dtor((zval**)iterator-intern.data);
iterator-intern.data = NULL; /* mark as unused */
+   zval_ptr_dtor(iterator-current);
+   zval_ptr_dtor(zfree);
 }
 /* }}} */
 
@@ -1359,12 +1360,15 @@
 static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
 {
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
+   zval *zfree = (zval*)iterator-intern.data;
 
if (iterator-current) {
zval_ptr_dtor(iterator-current);
}
-   zval_ptr_dtor((zval**)iterator-intern.data);
iterator-intern.data = NULL; /* mark as unused */
+   /* free twice as we add ref twice */
+   zval_ptr_dtor(zfree);
+   zval_ptr_dtor(zfree);
 }
 /* }}} */
 
@@ -1475,7 +1479,7 @@
dir_object = 
(spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
iterator   = spl_filesystem_object_to_iterator(dir_object);
 
-   Z_ADDREF_P(object);
+   Z_SET_REFCOUNT_P(object, Z_REFCOUNT_P(object) + 2);
iterator-intern.data = (void*)object;
iterator-intern.funcs = spl_filesystem_tree_it_funcs;
iterator-current = NULL;

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/dit_003.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/dit_003.phpt
+++ php-src/ext/spl/tests/dit_003.phpt
--TEST--
SPL: FilesystemIterator and foreach
--SKIPIF--
?php if (!extension_loaded(spl)) print skip; ?
--FILE--
?php
$count = 0;
foreach(new FilesystemIterator('CVS') as $ent)
{
++$count;
}
var_dump($count  0);
?
===DONE===
--EXPECTF--
bool(true)
===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-02-04 Thread Marcus Boerger
helly   Mon Feb  4 17:19:07 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - MFH Fix default flag value in contructor
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.12r2=1.45.2.27.2.23.2.13diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.12 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.13
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.12 Sat Feb  2 23:09:38 2008
+++ php-src/ext/spl/spl_directory.c Mon Feb  4 17:19:07 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.12 2008/02/02 23:09:38 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.13 2008/02/04 17:19:07 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -551,7 +551,7 @@
spl_filesystem_object *intern;
char *path;
int parsed, len;
-   long flags;
+   long flags = 0;
 
php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException 
TSRMLS_CC);
 
@@ -1148,7 +1148,7 @@
ZVAL_LONG(zflags, intern-flags);
ZVAL_STRINGL(zpath, intern-file_name, intern-file_name_len, 0);
 
-   spl_instantiate_arg_ex2(spl_ce_RecursiveDirectoryIterator, 
return_value, 0, zpath, zflags TSRMLS_CC);
+   spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, 0, zpath, 
zflags TSRMLS_CC);

subdir = 
(spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC);
if (subdir) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-02-04 Thread Marcus Boerger
helly   Mon Feb  4 18:46:13 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - MFH Fix #44018 (RecursiveDirectoryIterator options inconsistancy)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.13r2=1.45.2.27.2.23.2.14diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.13 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.14
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.13 Mon Feb  4 17:19:07 2008
+++ php-src/ext/spl/spl_directory.c Mon Feb  4 18:46:13 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.13 2008/02/04 17:19:07 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.14 2008/02/04 18:46:13 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -556,10 +556,8 @@
php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException 
TSRMLS_CC);
 
if (ctor_flags  DIT_CTOR_FLAGS) {
-   flags = SPL_FILE_DIR_CURRENT_AS_FILEINFO;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
s|l, path, len, flags);
} else {
-   flags = 0;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, 
path, len);
}
if (parsed == FAILURE) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c spl_directory.h

2008-02-04 Thread Marcus Boerger
helly   Mon Feb  4 19:33:10 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c spl_directory.h 
  Log:
  - MFH Really fix flag handling
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.14r2=1.45.2.27.2.23.2.15diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.14 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.15
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.14 Mon Feb  4 18:46:13 2008
+++ php-src/ext/spl/spl_directory.c Mon Feb  4 19:33:10 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.14 2008/02/04 18:46:13 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.15 2008/02/04 19:33:10 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -551,13 +551,15 @@
spl_filesystem_object *intern;
char *path;
int parsed, len;
-   long flags = 0;
+   long flags;
 
php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException 
TSRMLS_CC);
 
if (ctor_flags  DIT_CTOR_FLAGS) {
+   flags = 0;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
s|l, path, len, flags);
} else {
+   flags = 
SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF;
parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, 
path, len);
}
if (parsed == FAILURE) {
@@ -769,7 +771,7 @@
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-   if (intern-flags  SPL_FILE_DIR_KEY_AS_FILENAME) {
+   if (SPL_FILE_DIR_KEY(intern, SPL_FILE_DIR_KEY_AS_FILENAME)) {
RETURN_STRING(intern-u.dir.entry.d_name, 1);
} else {
spl_filesystem_object_get_file_name(intern TSRMLS_CC);
@@ -784,10 +786,10 @@
 {
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-   if (intern-flags  SPL_FILE_DIR_CURRENT_AS_PATHNAME) {
+   if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
spl_filesystem_object_get_file_name(intern TSRMLS_CC);
RETURN_STRINGL(intern-file_name, intern-file_name_len, 1);
-   } else if (intern-flags  SPL_FILE_DIR_CURRENT_AS_FILEINFO) {
+   } else if (SPL_FILE_DIR_CURRENT(intern, 
SPL_FILE_DIR_CURRENT_AS_FILEINFO)) {
spl_filesystem_object_get_file_name(intern TSRMLS_CC);
spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, 
return_value TSRMLS_CC);
} else {
@@ -1350,14 +1352,14 @@
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
spl_filesystem_object   *object   = 
spl_filesystem_iterator_to_object(iterator);
 
-   if (object-flags  SPL_FILE_DIR_CURRENT_AS_PATHNAME) {
+   if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
if (!iterator-current) {
ALLOC_INIT_ZVAL(iterator-current);
spl_filesystem_object_get_file_name(object TSRMLS_CC);
ZVAL_STRINGL(iterator-current, object-file_name, 
object-file_name_len, 1);
}
*data = iterator-current;
-   } else if (object-flags  SPL_FILE_DIR_CURRENT_AS_FILEINFO) {
+   } else if (SPL_FILE_DIR_CURRENT(object, 
SPL_FILE_DIR_CURRENT_AS_FILEINFO)) {
if (!iterator-current) {
ALLOC_INIT_ZVAL(iterator-current);
spl_filesystem_object_get_file_name(object TSRMLS_CC);
@@ -1375,7 +1377,7 @@
 {
spl_filesystem_object *object = 
spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);

-   if (object-flags  SPL_FILE_DIR_KEY_AS_FILENAME) {
+   if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) {
*str_key_len = strlen(object-u.dir.entry.d_name) + 1;
*str_key = estrndup(object-u.dir.entry.d_name, *str_key_len - 
1);
} else {
@@ -2350,17 +2352,17 @@
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO(arginfo_file_object_setFlags, 0) 
+ZEND_BEGIN_ARG_INFO(arginfo_file_object_setFlags, 0)
ZEND_ARG_INFO(0, flags)
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO(arginfo_file_object_setMaxLineLen, 0) 
+ZEND_BEGIN_ARG_INFO(arginfo_file_object_setMaxLineLen, 0)
ZEND_ARG_INFO(0, max_len)
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetcsv, 0, 0, 0) 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetcsv, 0, 0, 0)
ZEND_ARG_INFO(0, delimiter)
ZEND_ARG_INFO(0, enclosure)
 ZEND_END_ARG_INFO()
@@ -2470,9 +2472,9 @@
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, CURRENT_MODE_MASK,  
 SPL_FILE_DIR_CURRENT_MODE_MASK);

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-02-04 Thread Marcus Boerger
helly   Mon Feb  4 19:40:49 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - MFH Fix/add folding markers
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.15r2=1.45.2.27.2.23.2.16diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.15 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.16
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.15 Mon Feb  4 19:33:10 2008
+++ php-src/ext/spl/spl_directory.c Mon Feb  4 19:40:49 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.15 2008/02/04 19:33:10 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.16 2008/02/04 19:40:49 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -1227,7 +1227,7 @@
 }
 /* }}} */
 
-/* forward declarations to the iterator handlers */
+/* {{{ forward declarations to the iterator handlers */
 static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC);
 static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC);
 static void spl_filesystem_dir_it_current_data(zend_object_iterator *iter, 
zval ***data TSRMLS_DC);
@@ -1244,6 +1244,7 @@
spl_filesystem_dir_it_move_forward,
spl_filesystem_dir_it_rewind
 };
+/* }}} */
 
 /* {{{ spl_ce_dir_get_iterator */
 zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, 
zval *object, int by_ref TSRMLS_DC)
@@ -1276,7 +1277,7 @@
iterator-intern.data = NULL; /* mark as unused */
 }
 /* }}} */
-   
+
 /* {{{ spl_filesystem_dir_it_valid */
 static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC)
 {
@@ -1286,7 +1287,6 @@
 }
 /* }}} */
 
-
 /* {{{ spl_filesystem_dir_it_current_data */
 static void spl_filesystem_dir_it_current_data(zend_object_iterator *iter, 
zval ***data TSRMLS_DC)
 {
@@ -1345,7 +1345,7 @@
iterator-intern.data = NULL; /* mark as unused */
 }
 /* }}} */
-   
+
 /* {{{ spl_filesystem_tree_it_current_data */
 static void spl_filesystem_tree_it_current_data(zend_object_iterator *iter, 
zval ***data TSRMLS_DC)
 {
@@ -1430,7 +1430,7 @@
 }
 /* }}} */
 
-/* iterator handler table */
+/* {{{ iterator handler table */
 zend_object_iterator_funcs spl_filesystem_tree_it_funcs = {
spl_filesystem_tree_it_dtor,
spl_filesystem_dir_it_valid,
@@ -1439,6 +1439,7 @@
spl_filesystem_tree_it_move_forward,
spl_filesystem_tree_it_rewind
 };
+/* }}} */
 
 /* {{{ spl_ce_dir_get_iterator */
 zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, 
zval *object, int by_ref TSRMLS_DC)
@@ -1482,7 +1483,7 @@
 }
 /* }}} */
 
-/* declare method parameters */
+/* {{{ declare method parameters */
 /* supply a name and default to call by parameter */
 static
 ZEND_BEGIN_ARG_INFO(arginfo_info___construct, 0) 
@@ -1597,6 +1598,7 @@
SPL_ME(GlobIterator, count, NULL,  
ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
 };
+/* }}} */
 
 static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent 
TSRMLS_DC) /* {{{ */
 {
@@ -1692,12 +1694,12 @@
return result;
 } /* }}} */
 
-#define FileFunctionCall(func_name, pass_num_args, arg2) \
+#define FileFunctionCall(func_name, pass_num_args, arg2) /* {{{ */ \
 { \
zend_function *func_ptr; \
zend_hash_find(EG(function_table), #func_name, sizeof(#func_name), 
(void **) func_ptr); \
spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, 
arg2 TSRMLS_CC); \
-}
+} /* }}} */
 
 static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char 
delimiter, char enclosure, char escape, zval *return_value TSRMLS_DC) /* {{{ */
 {
@@ -2170,7 +2172,6 @@
RETURN_BOOL(!php_stream_flush(intern-u.file.stream));
 } /* }}} */
 
-
 /* {{{ proto int SplFileObject::ftell()
Return current file position */
 SPL_METHOD(SplFileObject, ftell)
@@ -2500,7 +2501,6 @@
 }
 /* }}} */
 
-
 /*
  * Local variables:
  * tab-width: 4

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-01-30 Thread Marcus Boerger
helly   Wed Jan 30 23:08:14 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - Sub path may be NULL
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.8r2=1.45.2.27.2.23.2.9diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.8 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.9
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.8  Wed Jan 30 20:31:06 2008
+++ php-src/ext/spl/spl_directory.c Wed Jan 30 23:08:13 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.8 2008/01/30 20:31:06 helly Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.9 2008/01/30 23:08:13 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -511,7 +511,11 @@
}
efree(pnstr);
pnstr = 
spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, subPathName, 
sizeof(subPathName)-1, pnlen TSRMLS_CC);
-   add_assoc_stringl_ex(zrv, pnstr, pnlen+1, 
intern-u.dir.sub_path, intern-u.dir.sub_path_len, 1);
+   if (intern-u.dir.sub_path) {
+   add_assoc_stringl_ex(zrv, pnstr, pnlen+1, 
intern-u.dir.sub_path, intern-u.dir.sub_path_len, 1);
+   } else {
+   add_assoc_stringl_ex(zrv, pnstr, pnlen+1, , 0, 1);
+   }
efree(pnstr);
}
if (intern-type == SPL_FS_FILE) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-01-30 Thread Marcus Boerger
helly   Wed Jan 30 23:45:13 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  - WS
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.9r2=1.45.2.27.2.23.2.10diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.9 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.10
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.9  Wed Jan 30 23:08:13 2008
+++ php-src/ext/spl/spl_directory.c Wed Jan 30 23:45:12 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.9 2008/01/30 23:08:13 helly Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.10 2008/01/30 23:45:12 helly Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -640,7 +640,7 @@
char *path;
int path_len;
 
-  path = spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
+   path = spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
RETURN_STRINGL(path, path_len, 1);
 }
 /* }}} */
@@ -652,7 +652,7 @@
spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
int path_len;
 
-  spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
+   spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);

if (path_len  path_len  intern-file_name_len) {
RETURN_STRINGL(intern-file_name + path_len + 1, 
intern-file_name_len - (path_len + 1), 1);
@@ -685,7 +685,7 @@
return;
}
 
-  spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
+   spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
 
if (path_len  path_len  intern-file_name_len) {
fname = intern-file_name + path_len + 1;
@@ -1034,7 +1034,7 @@
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |C, ce) == 
SUCCESS) {
int path_len;
-char *path = spl_filesystem_object_get_path(intern, path_len TSRMLS_CC);
+   char *path = spl_filesystem_object_get_path(intern, path_len 
TSRMLS_CC);
spl_filesystem_object_create_info(intern, path, path_len, 1, 
ce, return_value TSRMLS_CC);
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2008-01-30 Thread Elizabeth Marie Smith
auroraeosrose   Thu Jan 31 02:35:44 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  Fix windows build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.10r2=1.45.2.27.2.23.2.11diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.10 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.11
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.10 Wed Jan 30 23:45:12 2008
+++ php-src/ext/spl/spl_directory.c Thu Jan 31 02:35:44 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.10 2008/01/30 23:45:12 helly Exp $ 
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.11 2008/01/31 02:35:44 
auroraeosrose Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -194,7 +194,7 @@
 
if (intern-_path_len  (path[intern-_path_len-1] == '/'
 #if defined(PHP_WIN32) || defined(NETWARE)
-   || path[intern-path_len-1] == '\\'
+   || path[intern-_path_len-1] == '\\'
 #endif
)) {
intern-_path = estrndup(path, --intern-_path_len);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2007-10-05 Thread David Soria Parra
dsp Fri Oct  5 09:37:17 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  WS/Indent fix
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.2r2=1.45.2.27.2.23.2.3diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.2 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.3
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.2  Wed Oct  3 10:44:32 2007
+++ php-src/ext/spl/spl_directory.c Fri Oct  5 09:37:17 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.2 2007/10/03 10:44:32 dsp Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.3 2007/10/05 09:37:17 dsp Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -323,8 +323,7 @@
if (!file_path || !file_path_len) {
 #if defined(PHP_WIN32)
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, 
Cannot create SplFileInfo for empty path);
-   if (file_path  !use_copy)
-   {
+   if (file_path  !use_copy) {
efree(file_path);
}
return NULL;
@@ -1955,29 +1954,29 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sss, delim, 
d_len, enclo, e_len, esc, esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
-   case 3:
-   if (esc_len != 1) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, escape must be a character);
-   RETURN_FALSE;
-   }
-   escape = esc[0];
-/* no break */
-   case 2:
-   if (e_len != 1) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, enclosure must be a character);
-   RETURN_FALSE;
-   }
-   enclosure = enclo[0];
-   /* no break */
-   case 1:
-   if (d_len != 1) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, delimiter must be a character);
-   RETURN_FALSE;
-   }
-   delimiter = delim[0];
-   /* no break */
-   case 0:
-   break;
+   case 3:
+   if (esc_len != 1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
escape must be a character);
+   RETURN_FALSE;
+   }
+   escape = esc[0];
+   /* no break */
+   case 2:
+   if (e_len != 1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
enclosure must be a character);
+   RETURN_FALSE;
+   }
+   enclosure = enclo[0];
+   /* no break */
+   case 1:
+   if (d_len != 1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
delimiter must be a character);
+   RETURN_FALSE;
+   }
+   delimiter = delim[0];
+   /* no break */
+   case 0:
+   break;
}
spl_filesystem_file_read_csv(intern, delimiter, enclosure, 
escape, return_value TSRMLS_CC);
}
@@ -1996,29 +1995,29 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sss, delim, 
d_len, enclo, e_len, esc, esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
-case 3:
-   if (esc_len != 1) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, escape must be a character);
-   RETURN_FALSE;
-   }
-   escape = esc[0];
-/* no break */
-   case 2:
-   if (e_len != 1) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, enclosure must be a character);
-   RETURN_FALSE;
-   }
-   enclosure = enclo[0];
-   /* no break */
-   case 1:
-   if (d_len != 1) {
-   php_error_docref(NULL 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_directory.c

2007-10-05 Thread David Soria Parra
dsp Fri Oct  5 11:43:09 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_directory.c 
  Log:
  WS fix. Space instead of tab.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.3r2=1.45.2.27.2.23.2.4diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.3 
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.4
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.3  Fri Oct  5 09:37:17 2007
+++ php-src/ext/spl/spl_directory.c Fri Oct  5 11:43:09 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.3 2007/10/05 09:37:17 dsp Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.4 2007/10/05 11:43:09 dsp Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -323,7 +323,7 @@
if (!file_path || !file_path_len) {
 #if defined(PHP_WIN32)
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, 
Cannot create SplFileInfo for empty path);
-   if (file_path  !use_copy) {
+   if (file_path  !use_copy) {
efree(file_path);
}
return NULL;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php