Patch to get imap_mailboxmsginfo() work in Solaris (using cc, not gcc)

From: Date: Wed, 14 Jun 2000 18:08:36 +0000
Subject: Patch to get imap_mailboxmsginfo() work in Solaris (using cc, not gcc)
Groups: php.dev 
Request: Send a blank email to php-dev+get-21327@lists.php.net to get a copy of this message
It worked before in Linux(ix86) but not in Solaris 2.6 (SPARC). I'm using the Sun's cc not gcc in solaris..is it braindead or what? In linux I use gcc.. Index: ext/imap/php_imap.c =================================================================== RCS file: /repository/php4/ext/imap/php_imap.c,v retrieving revision 1.28 diff -u -r1.28 php_imap.c --- ext/imap/php_imap.c 2000/06/14 12:28:20 1.28 +++ ext/imap/php_imap.c 2000/06/14 17:41:15 @@ -2044,8 +2044,8 @@ /* }}} */ -/* {{{ proto array imap_mailboxmsginfo(int stream_id) - Returns info about the current mailbox in an associative array */ +/* {{{ proto object imap_mailboxmsginfo(int stream_id) + Returns info about the current mailbox */ PHP_FUNCTION(imap_mailboxmsginfo) { zval **streamind; @@ -2070,7 +2070,7 @@ RETURN_FALSE; } - /* Initialize return array */ + /* Initialize return object */ if (object_init(return_value) == FAILURE) { RETURN_FALSE; } @@ -2080,8 +2080,7 @@ for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) { MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream,msgno); mail_fetchstructure (imap_le_struct->imap_stream,msgno,NIL); - unreadmsg = cache->recent ? (cache->seen ? unreadmsg : unreadmsg++) : unreadmsg; - unreadmsg = (cache->recent | cache->seen) ? unreadmsg : unreadmsg++; + if(!cache->seen || cache->recent) unreadmsg++; msize = msize + cache->rfc822_size; } add_property_long(return_value, "Unread", unreadmsg); --Jani

« previous php.dev (#21327) next »