X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mh.c;h=7028dbfb62fb76805c0d086eb354b5a141ab5f69;hp=cbc7b8b62f75a6a43b7ddfc62dea1054611cbaba;hb=f335a8c113b45a45d2546630fd62ee950641a45e;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/mh.c b/mh.c index cbc7b8b..7028dbf 100644 --- a/mh.c +++ b/mh.c @@ -1,20 +1,11 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996-2002 Michael R. Elkins * Copyright (C) 1999-2002 Thomas Roessler - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ /* @@ -33,6 +24,10 @@ #include "buffy.h" #include "sort.h" +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" + #include #include #include @@ -47,11 +42,17 @@ #include #include +#if HAVE_SYS_TIME_H +#include +#endif + struct maildir { HEADER *h; char *canon_fname; unsigned header_parsed:1; +#ifdef USE_INODESORT ino_t inode; +#endif /* USE_INODESORT */ struct maildir *next; }; @@ -637,7 +638,9 @@ static int maildir_parse_entry (CONTEXT * ctx, struct maildir ***last, entry = safe_calloc (sizeof (struct maildir), 1); entry->h = h; entry->header_parsed = (ctx->magic == M_MH); +#ifdef USE_INODESORT entry->inode = inode; +#endif /* USE_INODESORT */ **last = entry; *last = &entry->next; @@ -747,6 +750,7 @@ static int maildir_move_to_context (CONTEXT * ctx, struct maildir **md) return r; } +#ifdef USE_INODESORT /* * Merge two maildir lists according to the inode numbers. */ @@ -823,6 +827,7 @@ static struct maildir *maildir_sort_inode (struct maildir *list) right = maildir_sort_inode (right); return maildir_merge_inode (left, right); } +#endif /* USE_INODESORT */ #if USE_HCACHE static size_t maildir_hcache_keylen (const char *fn) @@ -930,7 +935,9 @@ int mh_read_dir (CONTEXT * ctx, const char *subdir) mhs_free_sequences (&mhs); } +#ifdef USE_INODESORT md = maildir_sort_inode (md); +#endif /* USE_INODESORT */ if (ctx->magic == M_MAILDIR) maildir_delayed_parsing (ctx, md); @@ -989,7 +996,7 @@ static void maildir_flags (char *dest, size_t destlen, HEADER * hdr) hdr->read ? "S" : "", hdr->deleted ? "T" : "", NONULL (hdr->maildir_flags)); if (hdr->maildir_flags) - qsort (tmp, strlen (tmp), 1, ch_compar); + qsort (tmp, mutt_strlen (tmp), 1, ch_compar); snprintf (dest, destlen, ":2,%s", tmp); } }