Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Alex Waugh
In message cvswez1041415097@cvsserver
  Wez Furlong [EMAIL PROTECTED] wrote:

 wez   Wed Jan  1 04:58:17 2003 EDT
 
   Modified files:  
 /php4 acinclude.m4 configure.in 
 /php4/mainstreams.c 
   Log:
   Workaround for glibc 2.2.9x and later a+ bug that does not seek to EOF for
   files fopen()ed with that mode.

This breaks the build when cross compiling. Please could you add a
default option to AC_TRY_RUN

Cheers

Alex

-- 
Alex Waugh  [EMAIL PROTECTED]

RISC OS software from http://www.alexwaugh.com/

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




[PHP-CVS] cvs: php4 / Makefile.global

2003-01-02 Thread Derick Rethans
derick  Thu Jan  2 08:01:34 2003 EDT

  Modified files:  
/php4   Makefile.global 
  Log:
  - Fix make test when CC was set to something with a parameter
  
Index: php4/Makefile.global
diff -u php4/Makefile.global:1.41 php4/Makefile.global:1.42
--- php4/Makefile.global:1.41   Mon Dec  9 10:32:17 2002
+++ php4/Makefile.globalThu Jan  2 08:01:33 2003
@@ -49,7 +49,7 @@
 test: $(SAPI_CLI_PATH)
@TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
 TEST_PHP_SRCDIR=$(top_srcdir) \
-CC=$(CC) \
+CC=$(CC) \
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 
'safe_mode=0' $(top_srcdir)/run-tests.php $(TESTS)
 
 clean:



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




[PHP-CVS] cvs: php4(PHP_4_3) / Makefile.global

2003-01-02 Thread Derick Rethans
derick  Thu Jan  2 08:01:53 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   Makefile.global 
  Log:
  - MFH: Fix make test when CC was set to something with a parameter
  
  
Index: php4/Makefile.global
diff -u php4/Makefile.global:1.40 php4/Makefile.global:1.40.2.1
--- php4/Makefile.global:1.40   Tue Nov 12 12:40:38 2002
+++ php4/Makefile.globalThu Jan  2 08:01:53 2003
@@ -49,7 +49,7 @@
 test: $(SAPI_CLI_PATH)
@TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
 TEST_PHP_SRCDIR=$(top_srcdir) \
-CC=$(CC) \
+CC=$(CC) \
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 
'safe_mode=0' $(top_srcdir)/run-tests.php $(TESTS)
 
 clean:



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




[PHP-CVS] cvs: php4(PHP_4_3) /main php_streams.h

2003-01-02 Thread Derick Rethans
derick  Thu Jan  2 08:31:31 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  php_streams.h 
  Log:
  - MFH: Fix warnings on UnixWare
  
Index: php4/main/php_streams.h
diff -u php4/main/php_streams.h:1.61.2.5 php4/main/php_streams.h:1.61.2.6
--- php4/main/php_streams.h:1.61.2.5Tue Dec 31 11:26:21 2002
+++ php4/main/php_streams.h Thu Jan  2 08:31:30 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_streams.h,v 1.61.2.5 2002/12/31 16:26:21 sebastian Exp $ */
+/* $Id: php_streams.h,v 1.61.2.6 2003/01/02 13:31:30 derick Exp $ */
 
 #ifndef PHP_STREAMS_H
 #define PHP_STREAMS_H
@@ -318,8 +318,8 @@
 # define php_stream_to_zval(stream, zval)  { ZVAL_RESOURCE(zval, 
(stream)-rsrc_id); }
 #endif
 
-#define php_stream_from_zval(stream, ppzval)   ZEND_FETCH_RESOURCE2((stream), 
php_stream *, (ppzval), -1, stream, php_file_le_stream(), php_file_le_pstream())
-#define php_stream_from_zval_no_verify(stream, ppzval) (stream) = 
(php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, stream, NULL, 2, 
php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_zval(str, ppzval)  ZEND_FETCH_RESOURCE2((str), php_stream 
+*, (ppzval), -1, stream, php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_zval_no_verify(str, ppzval)(str) = 
+(php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, stream, NULL, 2, 
+php_file_le_stream(), php_file_le_pstream())
 
 PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream 
**stream TSRMLS_DC);
 #define PHP_STREAM_PERSISTENT_SUCCESS  0 /* id exists */



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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Derick Rethans
On Thu, 2 Jan 2003, Wez Furlong wrote:

 Defaulting to assuming that the target has a broken libc can cause race
 conditions (as the append operation is no-longer atomic).
 
 Default to assuming a working libc will cause a+ operations to fail
 when the target actually has a broken libc.

broken glibc  doesn't that imply that this define only need to be 
disabled for known broken systems and thus we can make the default not 
to define this thing.

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-



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




[PHP-CVS] cvs: php4(PHP_4_3) /main SAPI.h

2003-01-02 Thread Derick Rethans
derick  Thu Jan  2 12:58:58 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  SAPI.h 
  Log:
  
  
  
Index: php4/main/SAPI.h
diff -u php4/main/SAPI.h:1.87.2.1 php4/main/SAPI.h:1.87.2.2
--- php4/main/SAPI.h:1.87.2.1   Tue Dec 31 11:24:58 2002
+++ php4/main/SAPI.hThu Jan  2 12:58:57 2003
@@ -39,6 +39,7 @@
 #define SAPI_API
 #endif
 
+#undef shutdown
 
 typedef struct {
char *header;



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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Wez Furlong
But how can you reliably detect a system with a broken libc when
cross-compiling?

I leave this for someone else to decide, although a more-or-less
reasonable default is to for have_broken_glibc_fopen_append=no and
hope that no-one files a problem report :)

--Wez

On Thu, 2 Jan 2003, Derick Rethans wrote:

 On Thu, 2 Jan 2003, Wez Furlong wrote:

  Defaulting to assuming that the target has a broken libc can cause race
  conditions (as the append operation is no-longer atomic).
 
  Default to assuming a working libc will cause a+ operations to fail
  when the target actually has a broken libc.

 broken glibc  doesn't that imply that this define only need to be
 disabled for known broken systems and thus we can make the default not
 to define this thing.


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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Sascha Schumann
On Thu, 2 Jan 2003, Wez Furlong wrote:

 But how can you reliably detect a system with a broken libc when
 cross-compiling?

I don't think that you can successfully cross-compile PHP
anyway, so the point is moot anyway.

- Sascha

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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Alex Waugh
In message [EMAIL PROTECTED]
  Sascha Schumann [EMAIL PROTECTED] wrote:

 On Thu, 2 Jan 2003, Wez Furlong wrote:
 
  But how can you reliably detect a system with a broken libc when
  cross-compiling?
 
 I don't think that you can successfully cross-compile PHP
 anyway, so the point is moot anyway.

You can; I cross compile it regularly.

Alex

-- 
Alex Waugh  [EMAIL PROTECTED]

RISC OS software from http://www.alexwaugh.com/

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




[PHP-CVS] cvs: php4(PHP_4_3) / acinclude.m4 configure.in

2003-01-02 Thread Ilia Alshanetsky
iliaa   Thu Jan  2 14:21:55 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   configure.in acinclude.m4 
  Log:
  MFH
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.396.2.21 php4/configure.in:1.396.2.22
--- php4/configure.in:1.396.2.21Wed Jan  1 04:55:38 2003
+++ php4/configure.in   Thu Jan  2 14:21:52 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.396.2.21 2003/01/01 09:55:38 wez Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.396.2.22 2003/01/02 19:21:52 iliaa Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -728,7 +728,7 @@
 dnl OpenSSL configure
 dnl
 PHP_ARG_WITH(openssl,for OpenSSL support,
-[  --with-openssl[=DIR]Include OpenSSL support (requires OpenSSL = 0.9.5) ])
+[  --with-openssl[=DIR]Include OpenSSL support (requires OpenSSL = 0.9.6) ])
 
 if test $PHP_OPENSSL != no; then
   ext_openssl_shared=$ext_shared
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.218.2.3 php4/acinclude.m4:1.218.2.4
--- php4/acinclude.m4:1.218.2.3 Wed Jan  1 04:55:38 2003
+++ php4/acinclude.m4   Thu Jan  2 14:21:53 2003
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.218.2.3 2003/01/01 09:55:38 wez Exp $
+dnl $Id: acinclude.m4,v 1.218.2.4 2003/01/02 19:21:53 iliaa Exp $
 dnl
 dnl This file contains local autoconf functions.
 
@@ -211,13 +211,13 @@
   AC_MSG_CHECKING([for OpenSSL version])
   AC_EGREP_CPP(yes,[
 #include openssl/opensslv.h
-#if OPENSSL_VERSION_NUMBER = 0x0090500fL
+#if OPENSSL_VERSION_NUMBER = 0x0090600fL
   yes
 #endif
   ],[
-AC_MSG_RESULT([= 0.9.5])
+AC_MSG_RESULT([= 0.9.6])
   ],[
-AC_MSG_ERROR([OpenSSL version 0.9.5 or greater required.])
+AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
   ])
   CPPFLAGS=$old_CPPFLAGS
 



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




[PHP-CVS] cvs: php4 /ext/standard html.c /ext/standard/tests/strings bug21338.phpt

2003-01-02 Thread Ilia Alshanetsky
iliaa   Thu Jan  2 14:49:30 2003 EDT

  Added files: 
/php4/ext/standard/tests/stringsbug21338.phpt 

  Modified files:  
/php4/ext/standard  html.c 
  Log:
  Fixed bug #21338 (crash inside html_entity_decode() when  is passed).
  Added test case for the bug.
  
  
Index: php4/ext/standard/html.c
diff -u php4/ext/standard/html.c:1.68 php4/ext/standard/html.c:1.69
--- php4/ext/standard/html.c:1.68   Tue Dec 31 11:07:42 2002
+++ php4/ext/standard/html.cThu Jan  2 14:49:30 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.68 2002/12/31 16:07:42 sebastian Exp $ */
+/* $Id: html.c,v 1.69 2003/01/02 19:49:30 iliaa Exp $ */
 
 #include php.h
 #if PHP_WIN32
@@ -674,6 +674,9 @@

ret = estrdup(old);
retlen = oldlen;
+   if (!retlen) {
+   goto empty_source;
+   }

if (all) {
/* look for a match in the maps for this charset */
@@ -722,7 +725,7 @@
efree(ret);
ret = replaced;
}
-   
+empty_source:  
*newlen = retlen;
return ret;
 }

Index: php4/ext/standard/tests/strings/bug21338.phpt
+++ php4/ext/standard/tests/strings/bug21338.phpt
--TEST--
Bug #20934 (html_entity_decode() crash when  is passed)
--FILE--
?php
var_dump(html_entity_decode(NULL));
var_dump(html_entity_decode());
?
--EXPECT--
string(0) 
string(0) 



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




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-01-02 Thread Ilia Alshanetsky
iliaa   Thu Jan  2 14:52:19 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.38 php4/NEWS:1.1247.2.39
--- php4/NEWS:1.1247.2.38   Tue Dec 31 13:39:31 2002
+++ php4/NEWS   Thu Jan  2 14:52:18 2003
@@ -1,6 +1,7 @@
 PHP 4  NEWS
 |||
 ? ? ??? 200?, Version 4.3.1
+- Fixed bug #21338 (html_entity_decode() crashed when  is passed). (Ilia)
 - Improved dba extension (Marcus)
   . Added support for internal error handling of Berkeley db libraries.
   . Disallow Berkeley db versions 4.1.0 to 4.1.24 due to locking problems.



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




Re: [PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-01-02 Thread Derick Rethans
On Thu, 2 Jan 2003, Ilia Alshanetsky wrote:

 iliaa Thu Jan  2 14:52:19 2003 EDT
 
   Modified files:  (Branch: PHP_4_3)
 /php4 NEWS 
   Log:
   Bug fixing news.

Is it common to have an entry for every bug fix? If yes, I'll my fix 
too.

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Sascha Schumann
 You can; I cross compile it regularly.

What is your target/host platform then?

- Sascha

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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Alex Waugh
In message [EMAIL PROTECTED]
  Wez Furlong [EMAIL PROTECTED] wrote:

 But how can you reliably detect a system with a broken libc when
 cross-compiling?
 
 I leave this for someone else to decide, although a more-or-less
 reasonable default is to for have_broken_glibc_fopen_append=no and
 hope that no-one files a problem report :)

How about the following (completely untested, so I bet the brackets
don't match up :-) Not perfect, but better than a blind guess. Caching
the value also makes it easier to manually override if it gets it wrong.

Alex

AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[
  AC_MSG_CHECKING([for broken libc stdio])
  AC_CACHE_VAL(have_broken_glibc_fopen_append,[
  AC_TRY_RUN([
#include stdio.h
int main(int argc, char *argv[])
{
  FILE *fp;
  long position;
  char *filename = /tmp/phpglibccheck;
  
  fp = fopen(filename, w);
  if (fp == NULL) {
  perror(fopen);
  exit(2);
  }
  fputs(foobar, fp);
  fclose(fp);

  fp = fopen(filename, a+);
  position = ftell(fp);
  fclose(fp);
  unlink(filename);
  if (position == 0)
return 1;
  return 0;
}
],
[have_broken_glibc_fopen_append=no],
[have_broken_glibc_fopen_append=yes ],
AC_TRY_COMPILE([
#include features.h
],[
#if __GLIBC_PREREQ(2,2)
int main(void)
{
  return 0;
}
#else
choke me
#endif
],
[have_broken_glibc_fopen_append=yes ],
[have_broken_glibc_fopen_append=no ]
)
)])

  if test $have_broken_glibc_fopen_append = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on 
fopen with mode a+])
  else
AC_MSG_RESULT(no)
  fi
])


-- 
Alex Waugh  [EMAIL PROTECTED]

RISC OS software from http://www.alexwaugh.com/

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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Alex Waugh
In message [EMAIL PROTECTED]
  Sascha Schumann [EMAIL PROTECTED] wrote:

  You can; I cross compile it regularly.
 
 What is your target/host platform then?

Building on Linux, targetting RISC OS.

Alex

-- 
Alex Waugh  [EMAIL PROTECTED]

RISC OS software from http://www.alexwaugh.com/

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




[PHP-CVS] cvs: php4 /ext/openssl openssl.c

2003-01-02 Thread Ilia Alshanetsky
iliaa   Thu Jan  2 16:18:58 2003 EDT

  Modified files:  
/php4/ext/openssl   openssl.c 
  Log:
  Fixed a small memory leak when a NULL variable is passed to 
  openssl_csr_sign() as the first argument.
  
  
Index: php4/ext/openssl/openssl.c
diff -u php4/ext/openssl/openssl.c:1.60 php4/ext/openssl/openssl.c:1.61
--- php4/ext/openssl/openssl.c:1.60 Tue Dec 31 11:07:09 2002
+++ php4/ext/openssl/openssl.c  Thu Jan  2 16:18:58 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.60 2002/12/31 16:07:09 sebastian Exp $ */
+/* $Id: openssl.c,v 1.61 2003/01/02 21:18:58 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1310,8 +1310,9 @@
return (X509_REQ*)what;
}
return NULL;
+   } else if (Z_TYPE_PP(val) != IS_STRING) {
+   return NULL;
}
-   convert_to_string_ex(val);
 
if (Z_STRLEN_PP(val)  7  memcmp(Z_STRVAL_PP(val), file://, 7) == 0)
filename = Z_STRVAL_PP(val) + 7;



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




Re: [PHP-CVS] cvs: php4 / acinclude.m4 configure.in /main streams.c

2003-01-02 Thread Alex Waugh
In message [EMAIL PROTECTED]
  Sascha Schumann [EMAIL PROTECTED] wrote:

 On Thu, 2 Jan 2003, Alex Waugh wrote:
 
  In message [EMAIL PROTECTED]
Sascha Schumann [EMAIL PROTECTED] wrote:
 
You can; I cross compile it regularly.
  
   What is your target/host platform then?
 
  Building on Linux, targetting RISC OS.
 
 Are our defaults directly applicable to RISC OS?  Or how do
 you manage that configure produces an appropiate
 php_config.h for that target?

The vast majority of tests don't require running a test program,
therefore they work equally well whether cross compiling or not. On the
few that do, the default is usually fine. For those that it gets wrong
the easiest way to change them is to put the correct values in
config.cache before running configure. eg. currently I'm doing the
following:

cat  config.cache  EOF
ac_cv_path_PROG_SENDMAIL=\${ac_cv_path_PROG_SENDMAIL=\PHP\\\$Mail\}
lt_cv_prog_cc_can_build_shared=\${lt_cv_prog_cc_can_build_shared=no}
lt_cv_prog_cc_pic_works=\${lt_cv_prog_cc_pic_works=no}
EOF

./configure --host=arm-riscos-aof --with-config-file-path=/Choices:

Alex

-- 
Alex Waugh  [EMAIL PROTECTED]

RISC OS software from http://www.alexwaugh.com/

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




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-01-02 Thread Jani Taskinen
sniper  Thu Jan  2 19:05:08 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Group these entries a bit to make NEWS easier to read.
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.39 php4/NEWS:1.1247.2.40
--- php4/NEWS:1.1247.2.39   Thu Jan  2 14:52:18 2003
+++ php4/NEWS   Thu Jan  2 19:05:07 2003
@@ -1,13 +1,13 @@
 PHP 4  NEWS
 |||
 ? ? ??? 200?, Version 4.3.1
-- Fixed bug #21338 (html_entity_decode() crashed when  is passed). (Ilia)
 - Improved dba extension (Marcus)
   . Added support for internal error handling of Berkeley db libraries.
   . Disallow Berkeley db versions 4.1.0 to 4.1.24 due to locking problems.
   . Disallow linkage of Berkeley db submodules against libraries with
 different major version.
   . Disallow configuring of more than one Berkeley db handler. 
+- Fixed bug #21338 (html_entity_decode() crashed when  is passed). (Ilia)
 - Fixed bug #21229 (missing 3rd argument to php_module_startup). (Ilia)
 - Fixed bug #21267 (opening URLs that result in redirection to a relative
   path was failing). (Ilia)



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




[PHP-CVS] cvs: php4 / NEWS

2003-01-02 Thread Jani Taskinen
sniper  Thu Jan  2 19:06:24 2003 EDT

  Modified files:  
/php4   NEWS 
  Log:
  - Removed entries that are going to 4.3.1
  - Grouped the entries a bit.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1297 php4/NEWS:1.1298
--- php4/NEWS:1.1297Mon Dec 30 20:33:05 2002
+++ php4/NEWS   Thu Jan  2 19:06:23 2003
@@ -1,33 +1,16 @@
 PHP 4  NEWS
 |||
 ? ? ??? 200?, Version 4.4.0
-- Improved dba extension (Marcus)
-- Fixed bug #21229 (missing 3rd argument to php_module_startup). (Ilia)
-- Fixed bug #21267 (opening URLs that result in redirection to a relative
-  path was failing). (Ilia)
-- Fixed bug #21226 (parse_url handling of urls without a path). (Ilia)
-- Fixed bug #21228 (broken check for ob_gzhandler)  made ob_start() return
-  the correct value. (Ilia)
-- Fixed bug #21268 (session_decode() returned FALSE on success). (Ilia)
-- Improved dba extension (Marcus)
-  . Made handler parameter of dba_(p)open() optional.
-  . Added php.ini option 'dba.default_handler' to specify a default handler.
-  . Added parameter full_info to dba_handlers() that can be set true to 
-receive information about the handlers such like the library version.
-  . Added support for internal error handling of Berkeley db libraries.
-  . Disallow Berkeley db versions 4.1.0 to 4.1.24 due to locking problems.
-  . Disallow linkage of Berkeley db submodules against libraries with 
-different major version.
-  . Disallow configuring of more than one Berkeley db handler.
-- Fixed bug #17098 (make Apache aware that PHP scripts represent dynamic data
+- Fixed bug #17098 (make Apache2 aware that PHP scripts represent dynamic data
   and should not be cached). (Ilia)
-- Make uniqid() parameters optional and allow any prefix length. (Marcus)
-- New range() functionality (Ilia)
+- Fixed bug #20442 (upgraded bundled expat to 1.95.5). (Ilia)
+- Made uniqid() parameters to be optional and allow any prefix length. (Marcus)
+- Made array_search() to accept objects as a needle under ZendEngine2.
+  (Moriyoshi)
+- Added new range() functionality (Ilia)
   . Support for float modifier.
   . Detection of numeric values inside strings passed as high  low.
   . Proper handle the situations where high == low.
-- Let array_search() accept objects as a needle under ZendEngine2. (Moriyoshi)
-- Fixed bug #20442 (upgraded bundled expat to 1.95.5). (Ilia)
 - Added imagefilter() function which allows application of various filters.
   This function is only available with bundled GD. (Pierre-Alain Joye, Ilia)
 - Added imageistruecolor(), only available with GD2+(Pierre-Alain Joye)
@@ -36,7 +19,6 @@
. imageantialias($im, $flag) to (de)active antialias
. imageline antialias support
. imagepolygon antialias support
-
 
 27 Dec 2002, Version 4.3.0
 - Make PHP_AUTH_* variables not available in safe mode under Apache when an



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




[PHP-CVS] cvs: CVSROOT / modules

2003-01-02 Thread James Cox
imajes  Thu Jan  2 20:28:33 2003 EDT

  Modified files:  
/CVSROOTmodules 
  Log:
  duh! lets not loop cvs till it dies..
  
  
Index: CVSROOT/modules
diff -u CVSROOT/modules:1.30 CVSROOT/modules:1.31
--- CVSROOT/modules:1.30Mon Dec 30 21:19:05 2002
+++ CVSROOT/modules Thu Jan  2 20:28:31 2003
@@ -1,7 +1,7 @@
 #
 # The CVS Modules File
 #
-#ident @(#)cvs/examples:$Name:  $:$Id: modules,v 1.30 2002/12/31 02:19:05 imajes Exp 
$
+#ident @(#)cvs/examples:$Name:  $:$Id: modules,v 1.31 2003/01/03 01:28:31 imajes Exp 
+$
 #
 # Three different line formats are valid:
 #  key -aaliases...
@@ -92,7 +92,7 @@
 phpdoc-kr-dir -d kr phpdoc-kr
 phpdoc-kr-only phpdoc-kr
 phpdoc-kr phpdoc phpdoc-kr-dir
-phpdoc-lt-dir -d lt phpdoc-lt-dir
+phpdoc-lt-dir -d lt phpdoc-lt
 phpdoc-lt-only phpdoc-lt
 phpdoc-lt phpdoc phpdoc-lt-dir
 phpdoc-nl-dir -d nl phpdoc-nl



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




[PHP-CVS] cvs: CVSROOT / modules

2003-01-02 Thread James Cox
imajes  Thu Jan  2 20:30:03 2003 EDT

  Modified files:  
/CVSROOTmodules 
  Log:
  and that  too..
  
  
Index: CVSROOT/modules
diff -u CVSROOT/modules:1.31 CVSROOT/modules:1.32
--- CVSROOT/modules:1.31Thu Jan  2 20:28:31 2003
+++ CVSROOT/modules Thu Jan  2 20:30:03 2003
@@ -1,7 +1,7 @@
 #
 # The CVS Modules File
 #
-#ident @(#)cvs/examples:$Name:  $:$Id: modules,v 1.31 2003/01/03 01:28:31 imajes Exp 
$
+#ident @(#)cvs/examples:$Name:  $:$Id: modules,v 1.32 2003/01/03 01:30:03 imajes Exp 
+$
 #
 # Three different line formats are valid:
 #  key -aaliases...
@@ -92,7 +92,7 @@
 phpdoc-kr-dir -d kr phpdoc-kr
 phpdoc-kr-only phpdoc-kr
 phpdoc-kr phpdoc phpdoc-kr-dir
-phpdoc-lt-dir -d lt phpdoc-lt
+phpdoc-lt-dir -d lt phpdoc-lt
 phpdoc-lt-only phpdoc-lt
 phpdoc-lt phpdoc phpdoc-lt-dir
 phpdoc-nl-dir -d nl phpdoc-nl



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




[PHP-CVS] cvs: CVSROOT / avail

2003-01-02 Thread James Cox
imajes  Thu Jan  2 21:41:45 2003 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  give karma to phpdoc-lt properly.
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.568 CVSROOT/avail:1.569
--- CVSROOT/avail:1.568 Mon Dec 30 21:19:05 2002
+++ CVSROOT/avail   Thu Jan  2 21:41:45 2003
@@ -26,7 +26,7 @@
 # The PHP Documentation Group maintains the documentation and its
 # translations.
 
-avail|frogger,coldocean,alan_k,fleaslob,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sebastian,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,ufux,virtual,fireclaw,hadar_p,asautins,dbenson,aleczapka,flaviobrito,mattias,tom,amiller,cortesi,lancelot_,irc-html,mkaufman,rarruda,j-f,betz,philip,alindeman,thyla,cucinato,jpsantos,zyprexia,tpug,ozgurakan,mitja,conni,sts,stefanhinz,georg,nmav,subbie,leszek,spheroid,joona,kjartno,slawek,nooboo,alan_dangelo,ae,ahambazaza,nohn,kaser01,visualmind,abohamam,stefan,kurtz,luk,tronic,moh,bernd,wilko,yohgaki,fujimoto,gerzson,webler,spooky,tinenie,cece,daniel,offs,boo,nhoizey,nogada,albaity,joerg,mazen,neil536t,maco,imajes,hakan,chief977,dwestfal,ott,shlomi,holev,raful,yuval,tomer,masterjy,barak,ido,mork,lior,gal,adiju,cr_depend,cyberowl,daniel.paul,florian,iulianphp,kappu,michelinux,muricaru,narcotic,dt,valy,critix,spg1et,ck,costra,fancao0515,rbenea,tibee,ins0mnia,eriksson,wenz,jaxler,volker,avaly,bernardojts,bs,phaser,tal,sander,matroz,thales,dorun,ave,adu,adamf1,figuric,katow,l30n4rd0,samih,mmeier,wentzel,scaro,amtd,aspinei,costello,coti,lmaxcar,lucaiacono,manuzhai,mcastro,sukamade,darvina,peter,maxim,adir,roland,romakhin,jmurin,n0nick,attila,sagi,kai,microbrain,rhheo,shimi,k.schroeder,djworld,emil,lboshell,netholic,dmitry83,machado,progcom,verdana,yincheng,surfmax,arzt,nicos,chregu,msopacua,bbd,cyril,gregory,hudzilla,klean,mignoni,wiesemann,xqi,mersal,zruya,sean,staybyte,daif,aber_sabeel,alzahrani,ayman_h,thomaslio,sfox,jippie,floripa,ahxiao,akcakayaa,allhibi,aner,black,class007,digo,dima,dorons,eshare,hpop1,itay,juppie,mrmatrix,saad,thomasgm,xbite,tobsn,jome,analytik,outsider,heymarcel,asmodean,bader,elmaystro,spic,truelight,gnuhacker,_batman_,sachat,dallas,dart,dejan,zer0fill,steve3d,lm92,bradmssw,tahani,victor,erica,simonh,phpman,mrphp,notarius,joseph,mmkhajah,mohammed,proton,klootz,takashima,leoca,ahmad,abobader,fboudot,wurm,hakawy,felix,ahmedss,mahrous2020,yorgo,gal_ga,feyge,abodive,ama,andras,hassen,jkhdk,okamura,popov,xman,fernandoc,avenger,hwin,tix,alrehawi_,liuming,ramysaweres,astone,shiflett,jaenecke,bdensley,adamchan,jingfs,murphy,potatotsang,the_q,jsheets,phpclub,xelis,adrianr,equerci,phpcatala,tofanini,umut,kriga,ray,royhuggins,logician,almanar,alexws,gonik,haiaw,lkwang_cn,shadowwulf,telecart,pongsakorn,naveed,shivas,tularis|phpdoc,ZendAPI,phpdoc-ar,phpdoc-cs,phpdoc-de,phpdoc-es,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh

[PHP-CVS] cvs: php4 /ext/standard array.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:05:13 2003 EDT

  Modified files:  
/php4/ext/standard  array.c 
  Log:
  Fixed small leaks in array_map() in case the first parameter is NULL like
  array_map(NULL, array(...));
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.213 php4/ext/standard/array.c:1.214
--- php4/ext/standard/array.c:1.213 Tue Dec 31 11:07:31 2002
+++ php4/ext/standard/array.c   Fri Jan  3 00:05:12 2003
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.213 2002/12/31 16:07:31 sebastian Exp $ */
+/* $Id: array.c,v 1.214 2003/01/03 05:05:12 moriyoshi Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -3418,6 +3418,8 @@
WRONG_PARAM_COUNT;
}
 
+   RETVAL_NULL();
+
callback = *args[0];
if (Z_TYPE_P(callback) != IS_NULL) {
if (!zend_is_callable(callback, 0, callback_name)) {
@@ -3438,6 +3440,7 @@
if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #%d 
should be an array, i + 2);
efree(array_len);
+   efree(array_pos);
efree(args);
return;
}



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




[PHP-CVS] cvs: php4(PHP_4_3) /ext/standard array.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:12:06 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  array.c 
  Log:
  MFH
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.199.2.11 php4/ext/standard/array.c:1.199.2.12
--- php4/ext/standard/array.c:1.199.2.11Tue Dec 31 11:35:24 2002
+++ php4/ext/standard/array.c   Fri Jan  3 00:12:06 2003
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.199.2.11 2002/12/31 16:35:24 sebastian Exp $ */
+/* $Id: array.c,v 1.199.2.12 2003/01/03 05:12:06 moriyoshi Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -3328,6 +3328,8 @@
WRONG_PARAM_COUNT;
}
 
+   RETVAL_NULL();
+
callback = *args[0];
if (Z_TYPE_P(callback) != IS_NULL) {
if (!zend_is_callable(callback, 0, callback_name)) {
@@ -3348,6 +3350,7 @@
if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #%d 
should be an array, i + 2);
efree(array_len);
+   efree(array_pos);
efree(args);
return;
}



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




[PHP-CVS] cvs: php4(PHP_4_3) /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:13:11 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/iconv iconv.c 
  Log:
  Fixed shift-out sequence unawareness issue
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.65.2.2 php4/ext/iconv/iconv.c:1.65.2.3
--- php4/ext/iconv/iconv.c:1.65.2.2 Tue Dec 31 11:34:43 2002
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:13:11 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.65.2.2 2002/12/31 16:34:43 sebastian Exp $ */
+/* $Id: iconv.c,v 1.65.2.3 2003/01/03 05:13:11 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -230,6 +230,18 @@
efree(out_buffer);
return PHP_ICONV_ERR_UNKNOWN;
}
+
+   if (out_left  8) {
+   out_buffer = (char *) erealloc(out_buffer, out_size + 8);
+   }
+
+   /* flush the shift-out sequences */ 
+   result = icv(cd, NULL, NULL, out_p, out_left);
+
+   if (result == (size_t)(-1)) {
+   efree(out_buffer);
+   return PHP_ICONV_ERR_UNKNOWN;
+   }

*out_len = out_size - out_left;
out_buffer[*out_len] = '\0';
@@ -288,6 +300,34 @@
}
break;
}
+
+   if (result != (size_t)(-1)) {
+   /* flush the shift-out sequences */ 
+   for (;;) {
+   result = icv(cd, NULL, NULL, (char **) out_p, out_left);
+   out_size = bsz - out_left;
+
+   if (result != (size_t)(-1)) {
+   break;
+   }
+
+   if (errno == E2BIG) {
+   bsz += 16;
+   tmp_buf = (char *) erealloc(out_buf, bsz);
+
+   if (tmp_buf == NULL) {
+   break;
+   }
+   
+   out_p = out_buf = tmp_buf;
+   out_p += out_size;
+   out_left = bsz - out_size;
+   } else {
+   break;
+   }
+   }
+   }
+
icv_close(cd);
 
if (result == (size_t)(-1)) {
@@ -299,6 +339,7 @@
case EILSEQ:
retval = PHP_ICONV_ERR_ILLEGAL_SEQ;
break;
+
case E2BIG:
/* should not happen */
retval = PHP_ICONV_ERR_TOO_BIG;



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




[PHP-CVS] cvs: php4 /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:14:34 2003 EDT

  Modified files:  
/php4/ext/iconv iconv.c 
  Log:
  MFB: fixed shift-out sequence unawareness issue
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.68 php4/ext/iconv/iconv.c:1.69
--- php4/ext/iconv/iconv.c:1.68 Tue Dec 31 14:13:16 2002
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:14:34 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.68 2002/12/31 19:13:16 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.69 2003/01/03 05:14:34 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -240,7 +240,7 @@
size_t decoded_len;
unsigned char *retval;
 
-   unsigned int hexval_tbl[256] = {
+   static unsigned int hexval_tbl[256] = {
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -402,7 +402,19 @@
efree(out_buffer);
return PHP_ICONV_ERR_UNKNOWN;
}
-   
+
+   if (out_left  8) {
+   out_buffer = (char *) erealloc(out_buffer, out_size + 8);
+   }
+
+   /* flush the shift-out sequences */ 
+   result = icv(cd, NULL, NULL, out_p, out_left);
+
+   if (result == (size_t)(-1)) {
+   efree(out_buffer);
+   return PHP_ICONV_ERR_UNKNOWN;
+   }
+
*out_len = out_size - out_left;
out_buffer[*out_len] = '\0';
*out = out_buffer;
@@ -460,6 +472,34 @@
}
break;
}
+
+   if (result != (size_t)(-1)) {
+   /* flush the shift-out sequences */ 
+   for (;;) {
+   result = icv(cd, NULL, NULL, (char **) out_p, out_left);
+   out_size = bsz - out_left;
+
+   if (result != (size_t)(-1)) {
+   break;
+   }
+
+   if (errno == E2BIG) {
+   bsz += 16;
+   tmp_buf = (char *) erealloc(out_buf, bsz);
+
+   if (tmp_buf == NULL) {
+   break;
+   }
+   
+   out_p = out_buf = tmp_buf;
+   out_p += out_size;
+   out_left = bsz - out_size;
+   } else {
+   break;
+   }
+   }
+   }
+
icv_close(cd);
 
if (result == (size_t)(-1)) {
@@ -471,6 +511,7 @@
case EILSEQ:
retval = PHP_ICONV_ERR_ILLEGAL_SEQ;
break;
+
case E2BIG:
/* should not happen */
retval = PHP_ICONV_ERR_TOO_BIG;



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




[PHP-CVS] cvs: php4(PHP_4_3) /ext/iconv/tests eucjp2iso2022jp.phpt

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:15:54 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/iconv/tests   eucjp2iso2022jp.phpt 
  Log:
  Updated the test so it reflects the recent change on iconv.c
  
  
Index: php4/ext/iconv/tests/eucjp2iso2022jp.phpt
diff -u php4/ext/iconv/tests/eucjp2iso2022jp.phpt:1.4 
php4/ext/iconv/tests/eucjp2iso2022jp.phpt:1.4.2.1
--- php4/ext/iconv/tests/eucjp2iso2022jp.phpt:1.4   Tue Oct 29 11:25:23 2002
+++ php4/ext/iconv/tests/eucjp2iso2022jp.phpt   Fri Jan  3 00:15:54 2003
@@ -9,50 +9,19 @@
 /* include('test.inc'); */
 /* charset=EUC-JP */
 
-$str = 
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-;
+function hexdump($str) {
+   $len = strlen($str);
+   for ($i = 0; $i  $len; ++$i) {
+   printf(%02x, ord($str{$i}));
+   }
+   print \n;
+}
 
-$str = iconv(EUC-JP, ISO-2022-JP, $str);
-$str = base64_encode($str);
-echo $str.\n;
+$str = str_repeat(ÆüËܸì¥Æ¥­¥¹¥È¤È English text, 30);
+$str .= ÆüËܸì;
 
+echo hexdump(iconv(EUC-JP, ISO-2022-JP, $str));
 ?
 --EXPECT--
-ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0Cg==

[PHP-CVS] cvs: php4 /ext/iconv/tests eucjp2iso2022jp.phpt

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:16:12 2003 EDT

  Modified files:  
/php4/ext/iconv/tests   eucjp2iso2022jp.phpt 
  Log:
  MFB
  
  
Index: php4/ext/iconv/tests/eucjp2iso2022jp.phpt
diff -u php4/ext/iconv/tests/eucjp2iso2022jp.phpt:1.4 
php4/ext/iconv/tests/eucjp2iso2022jp.phpt:1.5
--- php4/ext/iconv/tests/eucjp2iso2022jp.phpt:1.4   Tue Oct 29 11:25:23 2002
+++ php4/ext/iconv/tests/eucjp2iso2022jp.phpt   Fri Jan  3 00:16:12 2003
@@ -9,50 +9,19 @@
 /* include('test.inc'); */
 /* charset=EUC-JP */
 
-$str = 
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-ÆüËܸì¥Æ¥­¥¹¥È¤ÈEnglish Text
-;
+function hexdump($str) {
+   $len = strlen($str);
+   for ($i = 0; $i  $len; ++$i) {
+   printf(%02x, ord($str{$i}));
+   }
+   print \n;
+}
 
-$str = iconv(EUC-JP, ISO-2022-JP, $str);
-$str = base64_encode($str);
-echo $str.\n;
+$str = str_repeat(ÆüËܸì¥Æ¥­¥¹¥È¤È English text, 30);
+$str .= ÆüËܸì;
 
+echo hexdump(iconv(EUC-JP, ISO-2022-JP, $str));
 ?
 --EXPECT--
-ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0ChskQkZ8S1w4bCVGJS0lOSVIJEgbKEJFbmdsaXNoIFRleHQKGyRCRnxLXDhsJUYlLSU5JUgkSBsoQkVuZ2xpc2ggVGV4dAobJEJGfEtcOGwlRiUtJTklSCRIGyhCRW5nbGlzaCBUZXh0Cg==

[PHP-CVS] cvs: php4 /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:26:45 2003 EDT

  Modified files:  
/php4/ext/iconv iconv.c 
  Log:
  Added missing casting operators
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.69 php4/ext/iconv/iconv.c:1.70
--- php4/ext/iconv/iconv.c:1.69 Fri Jan  3 00:14:34 2003
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:26:44 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.69 2003/01/03 05:14:34 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.70 2003/01/03 05:26:44 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -320,7 +320,7 @@
 
out_p = (d)-c + (d)-len;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == -1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == 
+(size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
switch (errno) { 
case EINVAL:
@@ -574,7 +574,7 @@
 
prev_in_left = in_left;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == -1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == 
+(size_t)-1) {
if (prev_in_left == in_left) {
break;
}
@@ -683,7 +683,7 @@
--len;
}
 
-   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == -1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == 
+(size_t)-1) {
if (prev_in_left == in_left) {
break;
}
@@ -785,7 +785,7 @@
 
prev_in_left = in_left;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == -1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == 
+(size_t)-1) {
if (prev_in_left == in_left) {
 #if ICONV_SUPPORTS_ERRNO
switch (errno) {
@@ -1000,7 +1000,7 @@
out_p = buf;
out_left = out_size = (char_cnt - 2) / 4 * 3;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, 
out_left) == -1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, 
+out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EINVAL:
@@ -1064,7 +1064,7 @@
out_p = buf;
out_left = out_size = 1;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, 
out_left) == -1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, 
+out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EINVAL:



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




[PHP-CVS] cvs: php4 /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:28:25 2003 EDT

  Modified files:  
/php4/ext/iconv iconv.c 
  Log:
  More shift-sequence awareness for iconv_substr()
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.70 php4/ext/iconv/iconv.c:1.71
--- php4/ext/iconv/iconv.c:1.70 Fri Jan  3 00:26:44 2003
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:28:25 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.70 2003/01/03 05:26:44 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.71 2003/01/03 05:28:25 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -311,41 +311,70 @@
size_t prev_in_left = in_left;
 #endif
 
-   while (in_left  0) {
-   out_left = buf_growth - out_left;
-   {
-   size_t newlen;
-   smart_str_alloc((d), out_left, 0);
-   }
+   if (in_p != NULL) {
+   while (in_left  0) {
+   out_left = buf_growth - out_left;
+   {
+   size_t newlen;
+   smart_str_alloc((d), out_left, 0);
+   }
 
-   out_p = (d)-c + (d)-len;
+   out_p = (d)-c + (d)-len;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == 
(size_t)-1) {
+   if (icv(cd, in_p, in_left, (char **) out_p, out_left) == 
+(size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
-   switch (errno) { 
-   case EINVAL:
-   return PHP_ICONV_ERR_ILLEGAL_CHAR;
+   switch (errno) { 
+   case EINVAL:
+   return PHP_ICONV_ERR_ILLEGAL_CHAR;
 
-   case EILSEQ:
-   return PHP_ICONV_ERR_ILLEGAL_SEQ;
+   case EILSEQ:
+   return PHP_ICONV_ERR_ILLEGAL_SEQ;
 
-   case E2BIG:
-   break;
+   case E2BIG:
+   break;
 
-   default:
-   return PHP_ICONV_ERR_UNKNOWN;
-   }
+   default:
+   return PHP_ICONV_ERR_UNKNOWN;
+   }
 #else
-   if (prev_in_left == in_left) {
-   return PHP_ICONV_ERR_UNKNOWN;   
+   if (prev_in_left == in_left) {
+   return PHP_ICONV_ERR_UNKNOWN;   
+   }
+#endif
}
+#if !ICONV_SUPPORTS_ERRNO
+   prev_in_left = in_left;
 #endif
+   (d)-len += (buf_growth - out_left);
+   buf_growth = 1;
}
-#if !ICONV_SUPPORTS_ERRNO
-   prev_in_left = in_left;
+   } else {
+   for (;;) {
+   out_left = buf_growth - out_left;
+   {
+   size_t newlen;
+   smart_str_alloc((d), out_left, 0);
+   }
+
+   out_p = (d)-c + (d)-len;
+
+   if (icv(cd, NULL, NULL, (char **) out_p, out_left) == 
+(size_t)0) {
+   (d)-len += (buf_growth - out_left);
+   break;
+   } else {
+#if ICONV_SUPPORTS_ERRNO
+   if (errno != E2BIG) {
+   return PHP_ICONV_ERR_UNKNOWN;
+   }
+#else
+   if (out_left != 0) {
+   return PHP_ICONV_ERR_UNKNOWN;
+   }   
 #endif
-   (d)-len += (buf_growth - out_left);
-   buf_growth = 1;
+   }
+   (d)-len += (buf_growth - out_left);
+   buf_growth = 1;
+   }
}
return PHP_ICONV_ERR_SUCCESS;
 }
@@ -622,7 +651,7 @@
 
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
 
-   iconv_t cd;
+   iconv_t cd1, cd2;
 
const char *in_p;
size_t in_left;
@@ -632,8 +661,6 @@
 
unsigned int cnt;
 
-   const char *substr_ofs;
-
/* normalize the offset and the length */
if (offset  0 || len  0) {
unsigned int total_len;
@@ -653,9 +680,9 @@
}
}
 
-   cd = icv_open(GENERIC_SUPERSET_NAME, enc);
+   cd1 = icv_open(GENERIC_SUPERSET_NAME, enc);
 
-

[PHP-CVS] cvs: php4 /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:32:13 2003 EDT

  Modified files:  
/php4/ext/iconv iconv.c 
  Log:
  Give mo' shift-sequence awareness to iconv_mime_encode
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.71 php4/ext/iconv/iconv.c:1.72
--- php4/ext/iconv/iconv.c:1.71 Fri Jan  3 00:28:25 2003
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:32:13 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.71 2003/01/03 05:28:25 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.72 2003/01/03 05:32:13 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1022,7 +1022,7 @@
in_left = fval_nbytes; 
 
do {
-   size_t prev_in_left = in_left;
+   size_t prev_in_left;
size_t out_size;
 
if (char_cnt  (out_charset_len + 12)) {
@@ -1041,39 +1041,84 @@
 
switch (enc_scheme) {
case PHP_ICONV_ENC_SCHEME_BASE64: {
+   size_t ini_in_left;
+   const char *ini_in_p;
+   size_t out_reserved = 4;
+
smart_str_appendc(pretval, 'B');
char_cnt--;
smart_str_appendc(pretval, '?');
char_cnt--;
 
-   out_p = buf;
-   out_left = out_size = (char_cnt - 2) / 4 * 3;
+   prev_in_left = ini_in_left = in_left;
+   ini_in_p = in_p;
 
-   if (icv(cd, in_p, in_left, (char **) out_p, 
out_left) == (size_t)-1) {
+   out_size = (char_cnt - 2) / 4 * 3;
+
+   for (;;) {
+   out_p = buf;
+
+   if (out_size = out_reserved) {
+   err = PHP_ICONV_ERR_TOO_BIG;
+   goto out;
+   }
+
+   out_left = out_size - out_reserved;
+
+   if (icv(cd, in_p, in_left, (char **) out_p, 
+out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
-   switch (errno) {
-   case EINVAL:
-   err = 
PHP_ICONV_ERR_ILLEGAL_CHAR;
-   goto out;
+   switch (errno) {
+   case EINVAL:
+   err = 
+PHP_ICONV_ERR_ILLEGAL_CHAR;
+   goto out;
 
-   case EILSEQ:
-   err = 
PHP_ICONV_ERR_ILLEGAL_SEQ;
-   goto out;
+   case EILSEQ:
+   err = 
+PHP_ICONV_ERR_ILLEGAL_SEQ;
+   goto out;
 
-   case E2BIG:
-   break;
+   case E2BIG:
+   break;
 
-   default:
+   default:
+   err = 
+PHP_ICONV_ERR_UNKNOWN;
+   goto out;
+   }
+#else
+   if (prev_in_left == in_left) {
err = PHP_ICONV_ERR_UNKNOWN;
goto out;
+   }
+#endif
}
+
+   out_left += out_reserved;
+
+   if (icv(cd, NULL, NULL, (char **) out_p, 
+out_left) == (size_t)-1) {
+#if ICONV_SUPPORTS_ERRNO
+   if (errno != E2BIG) {
+   err = PHP_ICONV_ERR_UNKNOWN;
+   goto out;
+   }
 #else
-   if (prev_in_left == in_left) {
+   if 

[PHP-CVS] cvs: php4 /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:34:06 2003 EDT

  Modified files:  
/php4/ext/iconv iconv.c 
  Log:
  Fixed infinite loop of iconv_mime_encode() in case the specified line length is too 
short to contain a proper mime-encoded string
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.72 php4/ext/iconv/iconv.c:1.73
--- php4/ext/iconv/iconv.c:1.72 Fri Jan  3 00:32:13 2003
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:34:05 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.72 2003/01/03 05:32:13 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.73 2003/01/03 05:34:05 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1077,6 +1077,10 @@
goto out;
 
case E2BIG:
+   if (prev_in_left == 
+in_left) {
+   err = 
+PHP_ICONV_ERR_TOO_BIG;
+   goto out;
+   }
break;
 
default:



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




[PHP-CVS] cvs: php4 /ext/iconv iconv.c

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:38:51 2003 EDT

  Modified files:  
/php4/ext/iconv iconv.c 
  Log:
  Fixed iconv_mime_decode() so it would give more awareness to stateful codesets
  
  
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.73 php4/ext/iconv/iconv.c:1.74
--- php4/ext/iconv/iconv.c:1.73 Fri Jan  3 00:34:05 2003
+++ php4/ext/iconv/iconv.c  Fri Jan  3 00:38:50 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.73 2003/01/03 05:34:05 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.74 2003/01/03 05:38:50 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1438,6 +1438,11 @@
}
}
 
+   if (cd != (iconv_t)(-1)) {
+   if ((err = _php_iconv_appendl(pretval, NULL, 0, cd)) != 
+PHP_ICONV_ERR_SUCCESS) {
+   goto out;
+   }
+   }
smart_str_0(pretval);
 out:
if (cd != (iconv_t)(-1)) {



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




[PHP-CVS] cvs: php4 /ext/iconv/tests iconv_strlen.phpt iconv_substr.phpt

2003-01-02 Thread Moriyoshi Koizumi
moriyoshi   Fri Jan  3 00:48:51 2003 EDT

  Added files: 
/php4/ext/iconv/tests   iconv_strlen.phpt iconv_substr.phpt 
  Log:
  Added test cases for iconv_strlen() and iconv_substr()
  
  

Index: php4/ext/iconv/tests/iconv_strlen.phpt
+++ php4/ext/iconv/tests/iconv_strlen.phpt
--TEST--
iconv_strlen()
--SKIPIF--
?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?
--FILE--
?php
function foo($str, $charset) {
var_dump(strlen($str));
var_dump(iconv_strlen($str, $charset));
}

foo(abc, ASCII);
foo(ÆüËܸì EUC-JP, EUC-JP);
?
--EXPECT--
int(3)
int(3)
int(13)
int(10)

Index: php4/ext/iconv/tests/iconv_substr.phpt
+++ php4/ext/iconv/tests/iconv_substr.phpt
--TEST--
iconv_substr()
--SKIPIF--
?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?
--INI--
iconv.internal_charset=ISO-8859-1
--FILE--
?php
function hexdump($str) {
$len = strlen($str);
for ($i = 0; $i  $len; ++$i) {
printf(%02x, ord($str{$i}));
}
print \n;
}

function foo($str, $offset, $len, $charset) {
hexdump(substr($str, $offset, $len));
hexdump(iconv_substr($str, $offset, $len, $charset));
}

function bar($str, $offset, $len = false) {
if (is_bool($len)) {
var_dump(substr($str, $offset));
var_dump(iconv_substr($str, $offset));
} else {
var_dump(substr($str, $offset, $len));
var_dump(iconv_substr($str, $offset, $len));
}
}

foo(abcdefghijklmnopqrstuvwxyz, 5, 7, ASCII);
foo(¤¢¤¤¤¦¤¨¤ª¤«¤­¤¯¤±¤³¤µ¤·¤¹, 5, 7, EUC-JP);
bar(This is a test, 10);
bar(This is a test, 0, 10);
bar(This is a test, -3);
bar(This is a test, 0, -9);
bar(This is a test, 0, -10);
bar(This is a test, -9, -10);
var_dump(iconv(ISO-2022-JP, EUC-JP, iconv_substr(iconv(EUC-JP, ISO-2022-JP, 
¤³¤ó¤Ë¤Á¤Ï ISO-2022-JP), 3, 8, ISO-2022-JP)));
?
--EXPECT--
666768696a6b6c
666768696a6b6c
a6a4a8a4aaa4ab
a4aba4ada4afa4b1a4b3a4b5a4b7
bool(false)
string(0) 
string(14) This is a test
string(14) This is a test
string(3) est
string(3) est
string(5) This 
string(5) This 
string(0) 
string(0) 
string(0) 
string(0) 
string(10) ¤Á¤Ï ISO-2



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