From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu From: David Swasey MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] manual suggestions and upas/fs bug Date: Mon, 16 Sep 2002 15:29:32 -0400 Topicbox-Message-UUID: ec692638-eaca-11e9-9e20-41e7f4b1d025 Hi, The malloc(2) page says: The call realloc(0, size) means the same as `malloc(size)'. Further, the call realloc(ptr, 0) means the same as `free(ptr)'. I suggest you clarify the meaning of realloc(0,0). The manual pages filter(1), mail(1), marshal(1), mlmgr(1), nedmail(1), upasfs(4), pop3(8), send(8), and smtp(8) refer to aliasmail(1) which does not exist. The file /sys/man/8/INDEX.html refers to aliasmail(8) which exists. I suggest you decide if its aliasmail(8) or aliasmail(1) and make the appropriate changes. Upas/fs dies when working with an empty IMAP4 mail box. There are two problems, both in /sys/src/cmd/upas/fs/imap4.c:/^imap4read. First, when imap->nmsg is 0, the erealloc() call will fail. Second, the IMAP4 server I talk to (cyrus) does not like the command "UID FETCH 1:* UID" when there are no messages. My fix was to change the semantics of erealloc(_,0) and to avoid the offending IMAP command. Diffs follow. -dave diff /n/dump/2002/0916/sys/src/cmd/upas/fs/imap4.c imap4.c 557,559c557,561 < imap4cmd(imap, "UID FETCH 1:* UID"); < if(!isokay(s = imap4resp(imap))) < return s; --- > if(imap->nmsg > 0){ > imap4cmd(imap, "UID FETCH 1:* UID"); > if(!isokay(s = imap4resp(imap))) > return s; > } diff /n/dump/2002/0916/sys/src/cmd/upas/fs/mbox.c mbox.c 1358c1358,1362 < p = realloc(p, n); --- > if(n==0){ > free(p); > p = malloc(n); > } else > p = realloc(p, n);