kalowsky Mon Sep 9 16:54:01 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/imap php_imap.c Log: Revert that last change, it had code that wasn't ment to go in Index: php4/ext/imap/php_imap.c diff -u php4/ext/imap/php_imap.c:1.112.2.5 php4/ext/imap/php_imap.c:1.112.2.6 --- php4/ext/imap/php_imap.c:1.112.2.5 Mon Sep 9 16:49:00 2002 +++ php4/ext/imap/php_imap.c Mon Sep 9 16:54:01 2002 @@ -25,7 +25,7 @@ | PHP 4.0 updates: Zeev Suraski <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_imap.c,v 1.112.2.5 2002/09/09 20:49:00 kalowsky Exp $ */ +/* $Id: php_imap.c,v 1.112.2.6 2002/09/09 20:54:01 kalowsky Exp $ */ #define IMAP41 @@ -376,28 +376,13 @@ */ void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist) { - zval *t_map; TSRMLS_FETCH(); /* this should only be run through once */ for (; qlist; qlist = qlist->next) { - MAKE_STD_ZVAL(t_map); - if (array_init(t_map) == FAILURE) { - php_error(E_WARNING, "Unable to allocate t_map memory"); - FREE_ZVAL(t_map); - FREE_ZVAL(IMAPG(quota_return)); - return; - } - if (strncmp(qlist->name, "STORAGE", 7) == 0) - { - add_assoc_long_ex(IMAPG(quota_return), "usage", sizeof("usage"), qlist->usage); - add_assoc_long_ex(IMPAG(quota_return), "limit", sizeof("limit"), qlist->limit); - } - - add_assoc_long_ex(t_map, "usage", sizeof("usage"), qlist->usage); - add_assoc_long_ex(t_map, "limit", sizeof("limit"), qlist->usage); - ass_assoc_zval_ex(IMAPG(quota_return), qlist->name, strlen(qlist->name)+1, t_map); + IMAPG(quota_usage) = qlist->usage; + IMAPG(quota_limit) = qlist->limit; } } /* }}} */ @@ -1059,13 +1044,6 @@ convert_to_string_ex(qroot); - MAKE_STD_ZVAL(IMAPG(quota_return)); - if (array_init(IMAPG(quota_return)) == FAILURE) { - php_error(E_WARNING, "Unable to allocate array memory"); - FREE_ZVAL(IMAPG(quota_return)); - RETURN_FALSE; - } - /* set the callback for the GET_QUOTA function */ mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota); if(!imap_getquota(imap_le_struct->imap_stream, Z_STRVAL_PP(qroot))) { @@ -1073,9 +1051,13 @@ RETURN_FALSE; } - *return_value = *IMAPG(quota_return); - FREE_ZVAL(IMAPG(quota_return)); - + if (array_init(return_value) == FAILURE) { + php_error(E_WARNING, "Unable to allocate array memory"); + RETURN_FALSE; + } + + add_assoc_long(return_value, "usage", IMAPG(quota_usage)); + add_assoc_long(return_value, "limit", IMAPG(quota_limit)); } /* }}} */ @@ -2218,7 +2200,7 @@ /* author: Andrew Skalski <[EMAIL PROTECTED]> */ zval **arg; const unsigned char *in, *inp, *endp; - unsigned char *out, *outp, c; + unsigned char *out, *outp; int inlen, outlen; enum { ST_NORMAL, /* printable text */ @@ -2320,15 +2302,13 @@ break; case ST_DECODE1: outp[1] = UNB64(*inp); - c = outp[1] >> 4; - *outp++ |= c; + *outp++ |= outp[1] >> 4; *outp <<= 4; state = ST_DECODE2; break; case ST_DECODE2: outp[1] = UNB64(*inp); - c = outp[1] >> 2; - *outp++ |= c; + *outp++ |= outp[1] >> 2; *outp <<= 6; state = ST_DECODE3; break; @@ -2361,7 +2341,7 @@ /* author: Andrew Skalski <[EMAIL PROTECTED]> */ zval **arg; const unsigned char *in, *inp, *endp; - unsigned char *out, *outp, c; + unsigned char *out, *outp; int inlen, outlen; enum { ST_NORMAL, /* printable text */ @@ -2432,8 +2412,7 @@ } else if (inp == endp || !SPECIAL(*inp)) { /* flush overflow and terminate region */ if (state != ST_ENCODE0) { - c = B64(*outp); - *outp++ = c; + *outp++ = B64(*outp); } *outp++ = '-'; state = ST_NORMAL; @@ -2441,20 +2420,17 @@ /* encode input character */ switch (state) { case ST_ENCODE0: - c = B64(*outp | *inp >> 4); - *outp = c; + *outp++ = B64(*inp >> 2); *outp = *inp++ << 4; state = ST_ENCODE1; break; case ST_ENCODE1: - c = B64(*outp | *inp >> 4); - *outp++ = c; + *outp++ = B64(*outp | *inp >> 4); *outp = *inp++ << 2; state = ST_ENCODE2; break; case ST_ENCODE2: - c = B64(*outp | *inp >> 6); - *outp++ = c; + *outp++ = B64(*outp | *inp >> 6); *outp++ = B64(*inp++); state = ST_ENCODE0; case ST_NORMAL:
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php