/*
+ * Copyright notice from original mutt:
* Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org>
- *
- * 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.
*/
#if HAVE_CONFIG_H
#include "mapping.h"
#include "mutt_crypt.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
for (i = 0; bindings[i].name; i++) {
if (!ascii_strncasecmp (start, bindings[i].name, len) &&
- mutt_strlen (bindings[i].name) == len)
+ safe_strlen (bindings[i].name) == len)
return bindings[i].op;
}
static void push_string (char *s)
{
- char *pp, *p = s + mutt_strlen (s) - 1;
+ char *pp, *p = s + safe_strlen (s) - 1;
size_t l;
int i, op = OP_NULL;
FOREVER {
strfcpy (s, km_keyname (map->keys[p]), len);
- len -= (l = mutt_strlen (s));
+ len -= (l = safe_strlen (s));
if (++p >= map->len || !len)
return (1);
int i;
for (i = 0; bindings[i].name; i++)
- if (mutt_strcmp (func, bindings[i].name) == 0) {
+ if (safe_strcmp (func, bindings[i].name) == 0) {
km_bindkey (key, menu, bindings[i].op);
return (0);
}
&& CurrentMenu != MENU_PAGER)
bindings = OpGeneric;
- ops[nops] = get_op (bindings, function, mutt_strlen (function));
+ ops[nops] = get_op (bindings, function, safe_strlen (function));
if (ops[nops] == OP_NULL && CurrentMenu != MENU_PAGER)
- ops[nops] = get_op (OpGeneric, function, mutt_strlen (function));
+ ops[nops] = get_op (OpGeneric, function, safe_strlen (function));
if (ops[nops] == OP_NULL) {
mutt_flushinp ();