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

2002-11-24 Thread Yasuo Ohgaki
Moriyoshi Koizumi wrote:

I suppose the problem was caused by wrong length passed to 
php_url_decode() and whether var has been altered doesn't have much to do 
with it.

Ah. I see. It's obvious bug.
I mixed up php_mbstr_encoding_handler :)

--
Yasuo Ohgaki




Moriyoshi

Yasuo Ohgaki [EMAIL PROTECTED] wrote:



var pointer will never be changed before/after
php_url_decode()

How this could be a bug?

--
Yasuo Ohgaki

Moriyoshi Koizumi wrote:


moriyoshi		Thu Nov 21 09:51:27 2002 EDT

 Modified files:  (Branch: PHP_4_3)
   /php4/ext/mbstring	mbstring.c 
 Log:
 Fixed yet another mb_parse_str() bug
 # This is reported by Ilia. Thanks!
 
 
 
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.142.2.2 php4/ext/mbstring/mbstring.c:1.142.2.3
--- php4/ext/mbstring/mbstring.c:1.142.2.2	Thu Nov 14 16:35:18 2002
+++ php4/ext/mbstring/mbstring.c	Thu Nov 21 09:51:26 2002
@@ -17,7 +17,7 @@
   +--+
 */

-/* $Id: mbstring.c,v 1.142.2.2 2002/11/14 21:35:18 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.142.2.3 2002/11/21 14:51:26 moriyoshi Exp $ */

/*
 * PHP4 Multibyte String module mbstring (currently only for Japanese)
@@ -1719,16 +1719,16 @@
	while (var  n  num) {
		val = strchr(var, '=');
		if (val) { /* have a value */
+			len_list[n] = php_url_decode(var, val-var);
			str_list[n] = var;
-			len_list[n] = php_url_decode(var, strlen(var));
			n++;

			*val++ = '\0';
			str_list[n] = val;
			len_list[n] = php_url_decode(val, strlen(val));
		} else {
-			str_list[n] = var;
			len_list[n] = php_url_decode(var, strlen(var));
+			str_list[n] = var;
			n++;

			str_list[n] = ;





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










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




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

2002-11-24 Thread Marcus Börger
At 08:45 24.11.2002, Yasuo Ohgaki wrote:

yohgaki Sun Nov 24 02:45:27 2002 EDT

  Modified files:
/php4/ext/pgsql pgsql.c
  Log:
  Added missing '\0'


Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244 php4/ext/pgsql/pgsql.c:1.245
--- php4/ext/pgsql/pgsql.c:1.244Tue Nov 12 04:07:36 2002
+++ php4/ext/pgsql/pgsql.c  Sun Nov 24 02:45:26 2002
@@ -19,7 +19,7 @@
+--+
  */

-/* $Id: pgsql.c,v 1.244 2002/11/12 09:07:36 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.245 2002/11/24 07:45:26 yohgaki Exp $ */

 #include stdlib.h

@@ -2730,7 +2730,8 @@
break;
}
}
-   buffer = erealloc(buffer, buflen);
+   buffer[buflen] = '\0';
+   buffer = erealloc(buffer, buflen+1);
if (buffer == NULL)
return NULL;



Erm shoudln't this better read:
+   buffer = erealloc(buffer, buflen+1);
+   buffer[buflen] = '\0';

as i understand the could it is possible that buflen will not be
decremented and then you would write zero behind the allocated
buffer.

marcus


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




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

2002-11-24 Thread Sterling Hughes
sterlingSun Nov 24 10:11:43 2002 EDT

  Modified files:  
/php4/ext/pgsql pgsql.c 
  Log:
  null after the erealloc()
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.245 php4/ext/pgsql/pgsql.c:1.246
--- php4/ext/pgsql/pgsql.c:1.245Sun Nov 24 02:45:26 2002
+++ php4/ext/pgsql/pgsql.c  Sun Nov 24 10:11:43 2002
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.245 2002/11/24 07:45:26 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.246 2002/11/24 15:11:43 sterling Exp $ */
 
 #include stdlib.h
 
@@ -2730,8 +2730,8 @@
break;
}
}
-   buffer[buflen] = '\0';
buffer = erealloc(buffer, buflen+1);
+   buffer[buflen] = 0;
if (buffer == NULL)
return NULL;
 



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




[PHP-CVS] cvs: php4 /tests/classes abstract_redeclare.phpt

2002-11-24 Thread Marcus Boerger
helly   Sun Nov 24 10:51:57 2002 EDT

  Added files: 
/php4/tests/classes abstract_redeclare.phpt 
  Log:
  Add test against redeclaring an overloaded method abstract
  
  

Index: php4/tests/classes/abstract_redeclare.phpt
+++ php4/tests/classes/abstract_redeclare.phpt
--TEST--
A method cannot be redeclared abstrcat
--SKIPIF--
?php if (version_compare(zend_version(), '2.0.0-dev', '')) die('skip ZendEngine 2 
needed'); ?
--FILE--
?php

class pass {
function show() {
echo Call to function show()\n;
}
}

class fail extends pass {
abstract function show();
}

echo Done\n; // Shouldn't be displayed
?
--EXPECTF--

Fatal error: Cannot redeclare pass::show() abstract in class fail in %s on line %d



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




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

2002-11-24 Thread Sterling Hughes
 sas   Sun Nov 24 11:23:38 2002 EDT
 
   Modified files:  
 /php4/ext/pgsql   pgsql.c 
   Log:
   Use proper form of NUL

I was under the assumption that 0 and '\0' were semantically equivalent.

-Sterling


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




Re: [PHP-CVS] cvs: php4 /ext/gd/libgd gdft.c

2002-11-24 Thread Ilia A.
On November 24, 2002 02:06 pm, Derick Rethans wrote:
 On Sun, 24 Nov 2002, Ilia Alshanetsky wrote:
  iliaa   Sat Nov 23 20:15:35 2002 EDT
 
Modified files:
  /php4/ext/gd/libgd  gdft.c
Log:
Fixed 3 memory leaks.
Formatted the code to meet PHP's coding standards, which makes it MUCH
  easier to understand.

 But it also makes back porting patched to the real GD _much_ harder, and
 that's why we didn't change the coding style yet AFAIK.


The bundled GD has already undergone a number of major modifications and as we 
implement the PHP memory wrappers around memory allocation  handling that 
difference will only increase. GD 2.0.4 and later already differ 
significantly because the code has been 'cleaned-up' by the gd authors, so I 
do not believe this is a big concern. On the plus side by increasing the 
readability of the code it would be possible to easily to port a few changes 
that do happen. As we speak, I am working on porting gd 2.0.7 code changes to 
2.0.4 and I can tell you doing diff + patch does not work @ all, beyond very 
small chucks of code.

Ilia

 Derick

  Index: php4/ext/gd/libgd/gdft.c
  diff -u php4/ext/gd/libgd/gdft.c:1.13 php4/ext/gd/libgd/gdft.c:1.14
  --- php4/ext/gd/libgd/gdft.c:1.13   Sun Nov 17 14:45:10 2002
  +++ php4/ext/gd/libgd/gdft.cSat Nov 23 20:15:34 2002
  @@ -330,153 +330,147 @@
 return (strcmp (a-fontlist, b-fontlist) == 0);
   }
 
  -static void *
  -fontFetch (char **error, void *key)
  +static void *fontFetch (char **error, void *key)
   {
  -  font_t *a;
  -  fontkey_t *b = (fontkey_t *) key;
  -  int n;
  -  int font_found = 0;
  -  unsigned short platform, encoding;
  -  char *fontsearchpath, *fontlist;
  -  char *fullname = NULL;
  -  char *name, *path, *dir;
  -  char *strtok_ptr;
  -  FT_Error err;
  -  FT_CharMap found = 0;
  -  FT_CharMap charmap;
  -
  -  a = (font_t *) gdMalloc (sizeof (font_t));
  -  a-fontlist = gdEstrdup (b-fontlist);
  -  a-library = b-library;
  -
  -  /*
  -   * Search the pathlist for any of a list of font names.
  -   */
  -  fontsearchpath = getenv (GDFONTPATH);
  -  if (!fontsearchpath)
  -fontsearchpath = DEFAULT_FONTPATH;
  -  fontlist = gdEstrdup (a-fontlist);
  -
  -  /*
  -   * Must use gd_strtok_r else pointer corrupted by strtok in nested
  loop. -   */
  -  for (name = gd_strtok_r (fontlist, LISTSEPARATOR, strtok_ptr); name;
  -   name = gd_strtok_r (0, LISTSEPARATOR, strtok_ptr))
  -{
  -
  -  /* make a fresh copy each time - strtok corrupts it. */
  -  path = gdEstrdup (fontsearchpath);
  -  /*
  -   * Allocate an oversized buffer that is guaranteed to be
  -   * big enough for all paths to be tested.
  -   */
  -  fullname = gdRealloc (fullname,
  -   strlen (fontsearchpath) + strlen (name) + 6);
  -  /* if name is an absolute filename then test directly */
  -  if (*name == '/' || (name[0] != 0  name[1] == ':'  (name[2] ==
  '/' || name[2] == '\\'))) - {
  - sprintf (fullname, %s, name);
  - if (access (fullname, R_OK) == 0)
  -   {
  - font_found++;
  - break;
  -   }
  -   }
  -  for (dir = strtok (path, PATHSEPARATOR); dir;
  -  dir = strtok (0, PATHSEPARATOR))
  -   {
  - sprintf (fullname, %s/%s.ttf, dir, name);
  - if (access (fullname, R_OK) == 0)
  -   {
  - font_found++;
  - break;
  -   }
  -  sprintf (fullname, %s/%s.pfa, dir, name);
  -  if (access (fullname, R_OK) == 0)
  -{
  - font_found++;
  - break;
  -   }
  - sprintf (fullname, %s/%s.pfb, dir, name);
  - if (access (fullname, R_OK) == 0)
  -   {
  - font_found++;
  -   break;
  -}
  -   }
  -  gdFree (path);
  -  if (font_found)
  -   break;
  -  }
  -  gdFree (fontlist);
  -  if (!font_found)
  -{
  -  *error = Could not find/open font;
  -  return NULL;
  -}
  -
  -  err = FT_New_Face (*b-library, fullname, 0, a-face);
  -  if (err)
  -{
  -  *error = Could not read font;
  -  return NULL;
  -}
  -  gdFree (fullname);
  -
  -/* FIXME - This mapping stuff is imcomplete - where is the spec? */
  -
  -  a-have_char_map_unicode = 0;
  -  a-have_char_map_big5 = 0;
  -  a-have_char_map_sjis = 0;
  -  a-have_char_map_apple_roman = 0;
  -  for (n = 0; n  a-face-num_charmaps; n++)
  -{
  -  charmap = a-face-charmaps[n];
  -  platform = charmap-platform_id;
  -  encoding = charmap-encoding_id;
  -  if ((platform == 3  encoding == 1) /* Windows Unicode */
  - || (platform == 3  encoding == 0)   /* Windows Symbol */
  - || (platform == 2  encoding == 1)   /* ISO Unicode */
  - || (platform == 0))
  -   {   /* Apple Unicode */
  - a-have_char_map_unicode = 1;
  - found = charmap;
  -   }
  -  else if (platform == 3  encoding == 4)
  -   {   /* Windows Big5 */
  - a-have_char_map_big5 = 1;

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

2002-11-24 Thread Moriyoshi Koizumi
moriyoshi   Sun Nov 24 14:21:59 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/mbstring  mbstring.c 
  Log:
  Fixed mb_parse_str() bug pointed out by Yasuo.
  
  
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.142.2.4 php4/ext/mbstring/mbstring.c:1.142.2.5
--- php4/ext/mbstring/mbstring.c:1.142.2.4  Thu Nov 21 11:21:33 2002
+++ php4/ext/mbstring/mbstring.cSun Nov 24 14:21:58 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.142.2.4 2002/11/21 16:21:33 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.142.2.5 2002/11/24 19:21:58 moriyoshi Exp $ */
 
 /*
  * PHP4 Multibyte String module mbstring
@@ -1691,8 +1691,11 @@
var = encstr;
n = Z_STRLEN_PP(arg_str);
while (n  0) {
-   if (*var == *separator) {
-   num++;
+   char *p;
+   for (p = separator; *p != '\0'; ++p) {
+   if (*p == *var) {
+   num++;
+   }
}
var++;
n--;



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




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

2002-11-24 Thread Sergey Kartashoff
gluke   Sun Nov 24 14:36:46 2002 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c 
  Log:
  @- A new functions have been added: udm_set_agent_param_ex and
 udm_get_res_field_ex
  - A new functions have been added: udm_set_agent_param_ex and
udm_get_res_field_ex  
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.66 php4/ext/mnogosearch/php_mnogo.c:1.67
--- php4/ext/mnogosearch/php_mnogo.c:1.66   Sat Sep 28 13:52:06 2002
+++ php4/ext/mnogosearch/php_mnogo.cSun Nov 24 14:36:45 2002
@@ -1,5 +1,5 @@
 /* $Source: /usr/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.66 2002/09/28 17:52:06 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.67 2002/11/24 19:36:45 gluke Exp $ */
 
 /*
+--+
@@ -163,6 +163,8 @@
 #if UDM_VERSION_ID = 30204
PHP_FE(udm_parse_query_string,  NULL)
PHP_FE(udm_make_excerpt,NULL)
+   PHP_FE(udm_set_agent_param_ex,  NULL)
+   PHP_FE(udm_get_res_field_ex,NULL)
 #endif
 #endif
 
@@ -1663,6 +1665,104 @@
}

RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto int udm_set_agent_param_ex(int agent, string var, string val)
+   Set mnoGoSearch agent session parameters extended */
+DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex)
+{
+   pval **yyagent, **yyvar, **yyval;
+   char *val, *var;
+   UDM_AGENT * Agent;
+
+   switch(ZEND_NUM_ARGS()){
+   
+   case 3: 
+   if(zend_get_parameters_ex(3,yyagent,yyvar,yyval)==FAILURE){
+   RETURN_FALSE;
+   }
+   convert_to_string_ex(yyvar);
+   convert_to_string_ex(yyval);
+   ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, 
+mnoGoSearch-agent, le_link);
+   var = Z_STRVAL_PP(yyvar);
+   val = Z_STRVAL_PP(yyval);
+   
+   break;
+   
+   default:
+   WRONG_PARAM_COUNT;
+   break;
+   }
+   
+   UdmVarListReplaceStr(Agent-Conf-Vars,var,val);
+   
+   if (!strcasecmp(var,LocalCharset)) {
+   const char * 
+charset=UdmVarListFindStr(Agent-Conf-Vars,LocalCharset,iso-8859-1);
+   Agent-Conf-lcs=UdmGetCharSet(charset);
+   } else if (!strcasecmp(var,BrowserCharset)) {
+   const char * 
+charset=UdmVarListFindStr(Agent-Conf-Vars,BrowserCharset,iso-8859-1);
+   Agent-Conf-bcs=UdmGetCharSet(charset);
+   } else if (!strcasecmp(var,Synonym)) {
+   if (UdmSynonymListLoad(Agent-Conf,val)) {
+   php_error(E_WARNING, %s(): %s, 
+get_active_function_name(TSRMLS_C),Agent-Conf-errstr);
+   RETURN_FALSE;
+   } else UdmSynonymListSort((Agent-Conf-Synonyms));
+   } else if (!strcasecmp(var,Stopwordfile)) {
+   if (UdmStopListLoad(Agent-Conf,val)) {
+   php_error(E_WARNING, %s(): %s, Agent-Conf-errstr, 
+get_active_function_name(TSRMLS_C));
+   RETURN_FALSE;
+   }
+   } else if (!strcasecmp(var,MinWordLen)) {
+   Agent-Conf-WordParam.min_word_len=atoi(val);
+   } else if (!strcasecmp(var,MaxWordLen)) {
+   Agent-Conf-WordParam.max_word_len=atoi(val);
+   } else if (!strcasecmp(var,VarDir)) {
+   
+snprintf(Agent-Conf-vardir,sizeof(Agent-Conf-vardir)-1,%s%s,val,UDMSLASHSTR);
+   }
+
+   RETURN_TRUE;
+}
+
+/* {{{ proto string udm_get_res_field_ex(int res, int row, string field)
+   Fetch mnoGoSearch result field */
+DLEXPORT PHP_FUNCTION(udm_get_res_field_ex)
+{
+   pval **yyres, **yyrow_num, **yyfield_name;
+
+   UDM_RESULT * Res;
+   int row;
+   char *field;
+   
+   switch(ZEND_NUM_ARGS()){
+   case 3: {
+   if (zend_get_parameters_ex(3, 
+yyres,yyrow_num,yyfield_name)==FAILURE){
+   RETURN_FALSE;
+   }
+   convert_to_string_ex(yyrow_num);
+   convert_to_string_ex(yyfield_name);
+   field = Z_STRVAL_PP(yyfield_name);
+   row = atoi(Z_STRVAL_PP(yyrow_num));
+   }
+   break;
+   default:
+   WRONG_PARAM_COUNT;
+   break;
+   }
+   
+   ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, mnoGoSearch-Result, 
+le_res);
+   if(rowRes-num_rows){
+   if (!strcasecmp(field,URL)) {
+   char*al;
+   al = (char *)MyRemoveHiLightDup((const char 

[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.h

2002-11-24 Thread Sergey Kartashoff
gluke   Sun Nov 24 14:39:47 2002 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.h 
  Log:
  - Header file update for new mnogosearch functions
  
  
Index: php4/ext/mnogosearch/php_mnogo.h
diff -u php4/ext/mnogosearch/php_mnogo.h:1.19 php4/ext/mnogosearch/php_mnogo.h:1.20
--- php4/ext/mnogosearch/php_mnogo.h:1.19   Sat Aug  3 04:53:26 2002
+++ php4/ext/mnogosearch/php_mnogo.hSun Nov 24 14:39:46 2002
@@ -1,5 +1,5 @@
 /* $Source: /usr/repository/php4/ext/mnogosearch/php_mnogo.h,v $ */
-/* $Id: php_mnogo.h,v 1.19 2002/08/03 08:53:26 gluke Exp $ */
+/* $Id: php_mnogo.h,v 1.20 2002/11/24 19:39:46 gluke Exp $ */
 
 /* 
+--+
@@ -68,6 +68,8 @@
 #if UDM_VERSION_ID = 30204
 DLEXPORT PHP_FUNCTION(udm_parse_query_string);
 DLEXPORT PHP_FUNCTION(udm_make_excerpt);
+DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex);
+DLEXPORT PHP_FUNCTION(udm_get_res_field_ex);
 #endif
 #endif
 



-- 
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/mbstring/tests mb_parse_str02.phpt

2002-11-24 Thread Moriyoshi Koizumi
moriyoshi   Sun Nov 24 14:48:18 2002 EDT

  Added files: (Branch: PHP_4_3)
/php4/ext/mbstring/testsmb_parse_str02.phpt 
  Log:
  Added a further test on mb_parse_str()
  
  

Index: php4/ext/mbstring/tests/mb_parse_str02.phpt
+++ php4/ext/mbstring/tests/mb_parse_str02.phpt



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




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

2002-11-24 Thread Yasuo Ohgaki
yohgaki Sun Nov 24 20:38:30 2002 EDT

  Modified files:  
/php4/ext/pgsql pgsql.c 
  Log:
  Cleanup state=4 and avoid using sscanf()
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.247 php4/ext/pgsql/pgsql.c:1.248
--- php4/ext/pgsql/pgsql.c:1.247Sun Nov 24 11:23:37 2002
+++ php4/ext/pgsql/pgsql.c  Sun Nov 24 20:38:29 2002
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.247 2002/11/24 16:23:37 sas Exp $ */
+/* $Id: pgsql.c,v 1.248 2002/11/25 01:38:29 yohgaki Exp $ */
 
 #include stdlib.h
 
@@ -2708,15 +2708,13 @@
case 3:
if (isdigit(*sp))   /* state=4 */
{
-   unsigned int  v,i;
-   unsigned char buf[4]; /* 000 + '\0' */
-
+   unsigned char *start, *end, buf[4]; /* 000 + 
+'\0' */
+   
bp -= 3;
-   for (i = 0; i  3; i++)
-   buf[i] = *((sp-2)+i);
-   buf[i] = '\0';
-   sscanf(buf, %03o, v);
-   *bp = v;
+   memcpy(buf, sp-2, 3);
+   buf[3] = '\0';
+   start = buf;
+   *bp = (unsigned char)strtoul(start, end, 8);
buflen -= 3;
state = 0;
}



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




[PHP-CVS] cvs: php4 /ext/gd config.m4 /ext/gd/libgd gd.c gd.h gd_gd2.c gd_jpeg.c gd_png.c gd_wbmp.c gdft.c gdxpm.c

2002-11-24 Thread Ilia Alshanetsky
iliaa   Sun Nov 24 20:51:53 2002 EDT

  Modified files:  
/php4/ext/gdconfig.m4 
/php4/ext/gd/libgd  gd.c gd.h gd_gd2.c gd_jpeg.c gd_png.c gd_wbmp.c 
gdft.c gdxpm.c 
  Log:
  Synchronized bundled gd library with the latest stable GD, 2.0.6
  Fixed a configuration problem with xpm.
  Fixed 2 possible memory leaks in fontFetch().
  
  
Index: php4/ext/gd/config.m4
diff -u php4/ext/gd/config.m4:1.123 php4/ext/gd/config.m4:1.124
--- php4/ext/gd/config.m4:1.123 Sun Nov 17 19:41:27 2002
+++ php4/ext/gd/config.m4   Sun Nov 24 20:51:52 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.123 2002/11/18 00:41:27 sniper Exp $
+dnl $Id: config.m4,v 1.124 2002/11/25 01:51:52 iliaa Exp $
 dnl
 
 dnl
@@ -112,7 +112,7 @@
 fi
 
 for i in include include/X11; do
-  test -f $GD_XPM_DIR/$i/xpm.h  GD_XPM_INC=$GD_XPM_DIR/$i
+  test -f $GD_XPM_DIR/$i/xpm.h  GD_XPM_INC=$GD_XPM_DIR/include
 done
 
 if test -z $GD_XPM_INC; then
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.27 php4/ext/gd/libgd/gd.c:1.28
--- php4/ext/gd/libgd/gd.c:1.27 Sun Nov 17 09:25:50 2002
+++ php4/ext/gd/libgd/gd.c  Sun Nov 24 20:51:52 2002
@@ -244,7 +244,7 @@
 #define RETURN_HWB(h, w, b) {HWB-H = h; HWB-W = w; HWB-B = b; return HWB;}
 #define RETURN_RGB(r, g, b) {RGB-R = r; RGB-G = g; RGB-B = b; return RGB;}
 #define HWB_UNDEFINED -1
-#define SETUP_RGB(s, r, g, b) {s.R = r/255.0f; s.G = g/255.0f; s.B = b/255.0f;}
+#define SETUP_RGB(s, r, g, b) {s.R = r/255.0; s.G = g/255.0; s.B = b/255.0;}
 
 #ifndef MIN
 #define MIN(a,b) ((a)(b)?(a):(b))
@@ -315,14 +315,14 @@
 
   if ((HWB1.H == HWB_UNDEFINED) || (HWB2.H == HWB_UNDEFINED))
 {
-  diff = 0.0f; /* Undefined hues always match... */
+  diff = 0;/* Undefined hues always match... */
 }
   else
 {
-  diff = fabsf (HWB1.H - HWB2.H);
-  if (diff  3.0f)
+  diff = abs (HWB1.H - HWB2.H);
+  if (diff  3)
{
- diff = 6.0f - diff;   /* Remember, it's a colour circle */
+ diff = 6 - diff;  /* Remember, it's a colour circle */
}
 }
 
@@ -375,8 +375,9 @@
 }
 
   return RGB;
+
 }
-#endif /* 0 */
+#endif
 
 int
 gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b)
@@ -516,12 +517,12 @@
  op = c;   /* Save open slot */
  continue; /* Color not in use */
}
-if (c == im-transparent)
-{
-/* don't ever resolve to the color that has
- * been designated as the transparent color */
-continue;
-}
+  if (c == im-transparent)
+{
+  /* don't ever resolve to the color that has
+   * been designated as the transparent color */
+  continue;
+   }
   rd = (long) (im-red[c] - r);
   gd = (long) (im-green[c] - g);
   bd = (long) (im-blue[c] - b);
@@ -873,10 +874,15 @@
   if (dy = dx)
 {
   /* More-or-less horizontal. use wid for vertical stroke */
-  wid = (int)(thick * cos (atan2 (dy, dx)));
-  if (wid == 0)
-   wid = 1;
-
+  /* Doug Claar: watch out for NaN in atan2 (2.0.5) */
+  if ((dx == 0)  (dy == 0)) {
+wid = 1;
+  } else {
+wid = thick * cos (atan2 (dy, dx));
+if (wid == 0) {
+  wid = 1;
+}
+  }
   d = 2 * dy - dx;
   incr1 = 2 * dy;
   incr2 = 2 * (dy - dx);
@@ -942,7 +948,7 @@
   else
 {
   /* More-or-less vertical. use wid for horizontal stroke */
-  wid = (int)(thick * sin (atan2 (dy, dx)));
+  wid = thick * sin (atan2 (dy, dx));
   if (wid == 0)
wid = 1;
 
@@ -1027,7 +1033,7 @@
   if (dy = dx)
 {
   /* More-or-less horizontal. use wid for vertical stroke */
-  wid = (int)(thick * sin (atan2 (dy, dx)));
+  wid = thick * sin (atan2 (dy, dx));
   vert = 1;
 
   d = 2 * dy - dx;
@@ -1086,7 +1092,7 @@
   else
 {
   /* More-or-less vertical. use wid for horizontal stroke */
-  wid = (int)(thick * sin (atan2 (dy, dx)));
+  wid = thick * sin (atan2 (dy, dx));
   vert = 0;
 
   d = 2 * dx - dy;
@@ -1790,6 +1796,7 @@
   for (x = srcX; (x  (srcX + w)); x++)
{
  int nc;
+  int mapTo;
  c = gdImageGetPixel (src, x, y);
  /* Added 7/24/95: support transparent copies */
  if (gdImageGetTransparent (src) == c)
@@ -1798,7 +1805,19 @@
  continue;
}
  /* Have we established a mapping for this color? */
- if (colorMap[c] == (-1))
+ if (src-trueColor)
+   {
+ /* 2.05: remap to the palette available in the
+destination image. This is slow and
+works badly, but it beats crashing! Thanks 
+ to Padhrig McCarthy. */
+ mapTo = gdImageColorResolveAlpha (dst,
+ gdTrueColorGetRed (c),
+

[PHP-CVS] cvs: CVSROOT / avail

2002-11-24 Thread Rasmus Lerdorf
rasmus  Mon Nov 25 02:51:57 2002 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  Some karma
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.547 CVSROOT/avail:1.548
--- CVSROOT/avail:1.547 Fri Nov 22 13:33:31 2002
+++ CVSROOT/avail   Mon Nov 25 02:51:56 2002
@@ -46,9 +46,9 @@
 # The PEAR Team has access to the full PEAR tree, the PEAR portion of
 # the PHP 4 tree, the PEAR website, and the PEAR documentation.
 
-avail|moh,sterling,jon,rael,jlp,sebastian,troels,urs,jpm,adaniel,tuupola,mj,metallic,richard,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,fireclaw,jmcastagnetto,kaltoft,jccann,amiller,mansion,zyprexia,alexmerz,yavo,clambert,vblavet,bernd,nohn,mog,mfischer,kvn,jan,eru,murahachibu,hayk,cain,nhoizey,aditus,ludoo,imajes,graeme,eriksson,maehdros,jasonlotito,dallen,lsmith,timmyg,pajoye,artka,tal,kk,cmv,rashid,alexios,baba,reywob,ekilfoil,floripa,sagi,jrust,mehl,dickmann,alan_k,fab,thku,busterb,miked,pgc,ctrlsoft,tychay,dexter,sachat,svenasse,mw21st,arahn,matthias,dias,jfbus,djanubis,derick,chief,sigi,tony,olivier,nepto,voyteck,cnb,dams,peterk,ernani,edink|pear,php4/pear,pearweb,peardoc
+avail|moh,sterling,jon,rael,jlp,sebastian,troels,urs,jpm,adaniel,tuupola,mj,metallic,richard,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,fireclaw,jmcastagnetto,kaltoft,jccann,amiller,mansion,zyprexia,alexmerz,yavo,clambert,vblavet,bernd,nohn,mog,mfischer,kvn,jan,eru,murahachibu,hayk,cain,nhoizey,aditus,ludoo,imajes,graeme,eriksson,maehdros,jasonlotito,dallen,lsmith,timmyg,pajoye,artka,tal,kk,cmv,rashid,alexios,baba,reywob,ekilfoil,floripa,sagi,jrust,mehl,dickmann,alan_k,fab,thku,busterb,miked,pgc,ctrlsoft,tychay,dexter,sachat,svenasse,mw21st,arahn,matthias,dias,jfbus,djanubis,derick,chief,sigi,tony,olivier,nepto,voyteck,cnb,dams,peterk,ernani,edink,quipo,egnited,arnaud|pear,php4/pear,pearweb,peardoc
 
-avail|philip|peardoc
+avail|philip,sroebke|peardoc
 avail|nicos|pear,peardoc
 
 # The PHP-GTK Group has access to the PHP-GTK code and documentation.



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




[PHP-CVS] cvs: CVSROOT / avail

2002-11-24 Thread Rasmus Lerdorf
rasmus  Mon Nov 25 02:56:51 2002 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  Karma
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.548 CVSROOT/avail:1.549
--- CVSROOT/avail:1.548 Mon Nov 25 02:51:56 2002
+++ CVSROOT/avail   Mon Nov 25 02:56:51 2002
@@ -27,7 +27,7 @@
 # The PHP Documentation Group maintains the documentation and its
 # translations.
 
-avail|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|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