cvs: php4 /ext/ircg ircg.c /ext/standard php_smart_str.h

From: Date: Sat, 29 Jun 2002 18:46:50 +0000
Subject: cvs: php4 /ext/ircg ircg.c /ext/standard php_smart_str.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12635@lists.php.net to get a copy of this message
sas Sat Jun 29 14:46:50 2002 EDT Modified files: /php4/ext/ircg ircg.c /php4/ext/standard php_smart_str.h Log: Fix some 8bit issues with IRCG nickname encoding and Change the underlying interface of smart_str to accept unsigned char. Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.131 php4/ext/ircg/ircg.c:1.132 --- php4/ext/ircg/ircg.c:1.131 Mon May 27 08:50:32 2002 +++ php4/ext/ircg/ircg.c Sat Jun 29 14:46:49 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg.c,v 1.131 2002/05/27 12:50:32 sas Exp $ */ +/* $Id: ircg.c,v 1.132 2002/06/29 18:46:49 sas Exp $ */ /* {{{ includes */ @@ -418,13 +418,14 @@ static void ircg_nickname_escape(smart_str *input, smart_str *output) { - char *p; - char *end; - char c; + unsigned char *p; + unsigned char *end; + unsigned char c; - end = input->c + input->len; + p = (unsigned char *) input->c; + end = p + input->len; - for(p = input->c; p < end; p++) { + while (p < end) { c = *p; if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') @@ -435,6 +436,7 @@ smart_str_appendc_ex(output, hextab[c >> 4], 1); smart_str_appendc_ex(output, hextab[c & 15], 1); } + p++; } } Index: php4/ext/standard/php_smart_str.h diff -u php4/ext/standard/php_smart_str.h:1.21 php4/ext/standard/php_smart_str.h:1.22 --- php4/ext/standard/php_smart_str.h:1.21 Tue May 7 23:56:43 2002 +++ php4/ext/standard/php_smart_str.h Sat Jun 29 14:46:49 2002 @@ -49,13 +49,13 @@ #define smart_str_append_long(dest, val) smart_str_append_long_ex(dest, val, 0) #define smart_str_append_unsigned(dest, val) smart_str_append_unsigned_ex(dest, val, 0) -static inline void smart_str_appendc_ex(smart_str *dest, char c, int what) +static inline void smart_str_appendc_ex(smart_str *dest, unsigned char c, int what) { size_t newlen; smart_str_alloc(dest, 1, what); dest->len = newlen; - dest->c[dest->len - 1] = c; + ((unsigned char *) dest->c)[dest->len - 1] = c; }

« previous php.cvs (#12635) next »