From 6fc06defd55e7d00f620d40e52da47bc4c1b3a96 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 14 Jun 2018 16:50:18 -0600 Subject: * More changes to make Valgrind happy. --- imap/src/osdep/unix/unix.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'imap/src/osdep/unix/unix.c') diff --git a/imap/src/osdep/unix/unix.c b/imap/src/osdep/unix/unix.c index cda5798c..74a1ffa9 100644 --- a/imap/src/osdep/unix/unix.c +++ b/imap/src/osdep/unix/unix.c @@ -21,7 +21,7 @@ * Internet: MRC@Washington.EDU * * Date: 20 December 1989 - * Last Edited: 27 March 2008 + * Last Edited: June 13 2018 by Eduardo Chappa */ @@ -586,8 +586,15 @@ void unix_close (MAILSTREAM *stream,long options) * Returns: message header in RFC822 format */ - /* lines to filter from header */ -static STRINGLIST *unix_hlines = NIL; + +STRINGLIST XIMAPbase = {"X-IMAPbase", 10, NIL}; +STRINGLIST XIMAP = {"X-IMAP", 6, &XIMAPbase}; +STRINGLIST XUID = {"X-UID", 5, &XIMAP}; +STRINGLIST XKeywords = {"X-Keywords", 10, &XUID}; +STRINGLIST XStatus = {"X-Status", 8, &XKeywords}; +STRINGLIST Status = {"Status", 6, &XStatus}; + +static STRINGLIST *unix_hlines = &Status; char *unix_header (MAILSTREAM *stream,unsigned long msgno, unsigned long *length,long flags) @@ -597,26 +604,6 @@ char *unix_header (MAILSTREAM *stream,unsigned long msgno, *length = 0; /* default to empty */ if (flags & FT_UID) return "";/* UID call "impossible" */ elt = mail_elt (stream,msgno);/* get cache */ - if (!unix_hlines) { /* once only code */ - STRINGLIST *lines = unix_hlines = mail_newstringlist (); - lines->text.size = strlen ((char *) (lines->text.data = - (unsigned char *) "Status")); - lines = lines->next = mail_newstringlist (); - lines->text.size = strlen ((char *) (lines->text.data = - (unsigned char *) "X-Status")); - lines = lines->next = mail_newstringlist (); - lines->text.size = strlen ((char *) (lines->text.data = - (unsigned char *) "X-Keywords")); - lines = lines->next = mail_newstringlist (); - lines->text.size = strlen ((char *) (lines->text.data = - (unsigned char *) "X-UID")); - lines = lines->next = mail_newstringlist (); - lines->text.size = strlen ((char *) (lines->text.data = - (unsigned char *) "X-IMAP")); - lines = lines->next = mail_newstringlist (); - lines->text.size = strlen ((char *) (lines->text.data = - (unsigned char *) "X-IMAPbase")); - } /* go to header position */ lseek (LOCAL->fd,elt->private.special.offset + elt->private.msg.header.offset,L_SET); -- cgit v1.2.3-54-g00ecf