@@ -45,7 +45,7 @@ static idx_msgnum_t num_by_aday[N_ADAY + 1];
45
45
static idx_msgnum_t msg_num ; /* number of actual messages in msgs[] */
46
46
static idx_msgnum_t msg_alloc ; /* (pre)allocated size of msgs[] (in messages) */
47
47
static struct idx_message * msgs ; /* flat array */
48
- static char * list ;
48
+ static const char * list ;
49
49
50
50
struct mem_message {
51
51
struct idx_message * msg ;
@@ -60,7 +60,7 @@ struct parsed_message {
60
60
struct tm tm ;
61
61
idx_hash_t msgid_hash , irt_hash ;
62
62
int have_msgid , have_irt ;
63
- char * from , * subject ;
63
+ const char * from , * subject ;
64
64
};
65
65
66
66
/* allocate new message in msgs[] */
@@ -534,7 +534,7 @@ static int mailbox_parse_fd(int fd)
534
534
}
535
535
msg .tm .tm_year = 0 ;
536
536
if (line [length - 1 ] == '\n' ) {
537
- char * p = memchr (line + 5 , ' ' , length - 5 );
537
+ const char * p = memchr (line + 5 , ' ' , length - 5 );
538
538
if (p ) {
539
539
p = strptime (p , " %a %b %d %T %Y" , & msg .tm );
540
540
if (!p || * p != '\n' )
@@ -594,7 +594,7 @@ static int mailbox_parse_fd(int fd)
594
594
case 'i' :
595
595
if (eq (p , l , "Message-ID:" , 11 ) ||
596
596
eq (p , l , "In-Reply-To:" , 12 )) {
597
- char * q ;
597
+ const char * q ;
598
598
p = mime_decode_header (& mime );
599
599
while (* p && * p != '<' )
600
600
p ++ ;
@@ -663,7 +663,7 @@ static int mailbox_parse_fd(int fd)
663
663
p ++ ;
664
664
msg .subject = p ;
665
665
while ((p = strchr (p , '[' ))) {
666
- char * q ;
666
+ const char * q ;
667
667
if (strncasecmp (++ p , list , strlen (list )))
668
668
continue ;
669
669
q = p + strlen (list );
@@ -704,10 +704,11 @@ static int mailbox_parse_fd(int fd)
704
704
return !done ;
705
705
}
706
706
707
- int mailbox_parse (char * mailbox )
707
+ int mailbox_parse (const char * mailbox )
708
708
{
709
+ const char * p ;
709
710
int fd , idx_fd ;
710
- char * idx , * p ;
711
+ char * idx ;
711
712
off_t idx_size ;
712
713
size_t msgs_size ;
713
714
int error ;
0 commit comments