iliaa Sun Apr 5 14:10:50 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/imap php_imap.c Log: Define _php_rfc822_len() only when needed http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.43&r2=1.208.2.7.2.44&diff_format=u Index: php-src/ext/imap/php_imap.c diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.43 php-src/ext/imap/php_imap.c:1.208.2.7.2.44 --- php-src/ext/imap/php_imap.c:1.208.2.7.2.43 Wed Dec 31 11:17:38 2008 +++ php-src/ext/imap/php_imap.c Sun Apr 5 14:10:49 2009 @@ -26,7 +26,7 @@ | PHP 4.0 updates: Zeev Suraski <z...@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_imap.c,v 1.208.2.7.2.43 2008/12/31 11:17:38 sebastian Exp $ */ +/* $Id: php_imap.c,v 1.208.2.7.2.44 2009/04/05 14:10:49 iliaa Exp $ */ #define IMAP41 @@ -3886,38 +3886,11 @@ } /* }}} */ -/* {{{ _php_rfc822_len - * Calculate string length based on imap's rfc822_cat function. - */ -static int _php_rfc822_len(char *str) -{ - int len; - char *p; - - if (!str || !*str) { - return 0; - } - - /* strings with special characters will need to be quoted, as a safety measure we - * add 2 bytes for the quotes just in case. - */ - len = strlen(str) + 2; - p = str; - /* rfc822_cat() will escape all " and \ characters, therefor we need to increase - * our buffer length to account for these characters. - */ - while ((p = strpbrk(p, "\\\""))) { - p++; - len++; - } - - return len; -} -/* }}} */ /* Support Functions */ #ifdef HAVE_RFC822_OUTPUT_ADDRESS_LIST + /* {{{ _php_rfc822_soutr */ static long _php_rfc822_soutr (void *stream, char *string) @@ -3953,6 +3926,36 @@ #else +/* {{{ _php_rfc822_len + * Calculate string length based on imap's rfc822_cat function. + */ +static int _php_rfc822_len(char *str) +{ + int len; + char *p; + + if (!str || !*str) { + return 0; + } + + /* strings with special characters will need to be quoted, as a safety measure we + * add 2 bytes for the quotes just in case. + */ + len = strlen(str) + 2; + p = str; + /* rfc822_cat() will escape all " and \ characters, therefor we need to increase + * our buffer length to account for these characters. + */ + while ((p = strpbrk(p, "\\\""))) { + p++; + len++; + } + + return len; +} +/* }}} */ + + /* {{{ _php_imap_get_address_size */ static int _php_imap_address_size (ADDRESS *addresslist)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php