/*
+ * Copyright notice from original mutt:
* Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
* Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
- *
- * 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.
+ *
+ * Parts were written/modified by:
+ * Rocco Rutte <pdmef@cs.tu-berlin.de>
+ * Nico Golde <nico@ngolde.de>
+ *
+ * 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.
*/
-
-
#include "mutt.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "sidebar.h"
#include "buffy.h"
-#include <libgen.h>
#include "keymap.h"
+
+#include "lib/mem.h"
+#include "lib/str.h"
+#include "lib/intl.h"
+
+#include <libgen.h>
#include <ctype.h>
/*BUFFY *CurBuffy = 0;*/
int i, j;
char *new_box;
- for (i = 0; i < strlen (box); ++i) {
+ for (i = 0; i < mutt_strlen (box); ++i) {
if (box[i] == '.')
++dots;
else if (isupper (box[i]))
last_dot = strrchr (box, '.');
if (last_dot) {
++last_dot;
- new_box = safe_malloc (strlen (last_dot) + 2 * dots + 1);
+ new_box = safe_malloc (mutt_strlen (last_dot) + 2 * dots + 1);
new_box[0] = box[0];
- for (i = 1, j = 1; i < strlen (box); ++i) {
+ for (i = 1, j = 1; i < mutt_strlen (box); ++i) {
if (box[i] == '.') {
new_box[j++] = '.';
new_box[j] = 0;
entry[SidebarWidth] = 0;
for (; i < SidebarWidth; entry[i++] = ' ');
#if USE_IMAP
- if (ImapHomeNamespace && strlen (ImapHomeNamespace) > 0) {
- if (strncmp (box, ImapHomeNamespace, strlen (ImapHomeNamespace)) == 0
+ if (ImapHomeNamespace && mutt_strlen (ImapHomeNamespace) > 0) {
+ if (strncmp (box, ImapHomeNamespace, mutt_strlen (ImapHomeNamespace)) == 0
&& strcmp (box, ImapHomeNamespace) != 0) {
- box += strlen (ImapHomeNamespace) + 1;
+ box += mutt_strlen (ImapHomeNamespace) + 1;
}
}
#endif
box = shortened_hierarchy (box);
shortened = 1;
}
- i = strlen (box);
+ i = mutt_strlen (box);
strncpy (entry, box, i < SidebarWidth - dlen ? i : SidebarWidth - dlen);
if (new) {
return;
while (1) {
- if (!strcmp (tmp->path, buf)) {
+ if (!mutt_strcmp (tmp->path, buf)) {
CurBuffy = tmp;
break;
}
if (!Context)
return;
while (tmp) {
- if (strcmp (tmp->path, Context->path) == 0) {
+ if (mutt_strcmp (tmp->path, Context->path) == 0) {
tmp->new = Context->new;
tmp->msg_unread = Context->unread;
tmp->msgcount = Context->msgcount;
move (lines, SidebarWidth - delim_len);
if (option (OPTASCIICHARS))
addstr (NONULL (SidebarDelim));
- else if (!option (OPTASCIICHARS) && !strcmp (SidebarDelim, "|"))
+ else if (!option (OPTASCIICHARS) && !mutt_strcmp (SidebarDelim, "|"))
addch (ACS_VLINE);
- else if ((Charset_is_utf8) && !strcmp (SidebarDelim, "|"))
+ else if ((Charset_is_utf8) && !mutt_strcmp (SidebarDelim, "|"))
addstr ("\342\224\202");
else
addstr (NONULL (SidebarDelim));
move (lines, 0);
if (option (OPTSIDEBARNEWMAILONLY)) {
if (tmp->msg_unread > 0) {
- if (Context && !strcmp (tmp->path, Context->path)) {
+ if (Context && !mutt_strcmp (tmp->path, Context->path)) {
printw ("%.*s", SidebarWidth - delim_len,
make_sidebar_entry (basename (tmp->path),
Context->msgcount, Context->unread,