diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 22:14:00 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 22:14:00 +0000 |
commit | a3f726e35f1e7d918061074a85ebe7a2c7c300a5 (patch) | |
tree | d9ab2a281be2a13fbb1ec8682d4e5c7ff0502cde /keymap.c | |
parent | 912c6b0df82fe3a2745d68131db9300222226a73 (diff) |
Introduce or rewrite mutt_{str*cmp,strlen} and use them all over the
place. If there are still segmentation faults due to missing
NONULLs over, they are gone now.
Diffstat (limited to 'keymap.c')
-rw-r--r-- | keymap.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -231,8 +231,8 @@ static int get_op (struct binding_t *bindings, const char *start, size_t len) for (i = 0; bindings[i].name; i++) { - if (!strncasecmp (start, bindings[i].name, len) && - strlen (bindings[i].name) == len) + if (!mutt_strncasecmp (start, bindings[i].name, len) && + mutt_strlen (bindings[i].name) == len) return bindings[i].op; } @@ -254,7 +254,7 @@ static char *get_func (struct binding_t *bindings, int op) static void push_string (char *s) { - char *pp, *p = s + strlen (s) - 1; + char *pp, *p = s + mutt_strlen (s) - 1; size_t l; int i, op = OP_NULL; @@ -271,7 +271,7 @@ static void push_string (char *s) l = p - pp + 1; for (i = 0; KeyNames[i].name; i++) { - if (!strncasecmp (pp, KeyNames[i].name, l)) + if (!mutt_strncasecmp (pp, KeyNames[i].name, l)) break; } if (KeyNames[i].name) @@ -495,7 +495,7 @@ int km_expand_key (char *s, size_t len, struct keymap_t *map) FOREVER { strfcpy (s, km_keyname (map->keys[p]), len); - len -= (l = strlen (s)); + len -= (l = mutt_strlen (s)); if (++p >= map->len || !len) return (1); @@ -690,7 +690,7 @@ try_bind (char *key, int menu, char *func, struct binding_t *bindings) int i; for (i = 0; bindings[i].name; i++) - if (strcmp (func, bindings[i].name) == 0) + if (mutt_strcmp (func, bindings[i].name) == 0) { km_bindkey (key, menu, bindings[i].op); return (0); @@ -751,7 +751,7 @@ int mutt_parse_bind (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) strfcpy (err->data, _("bind: too many arguments"), err->dsize); r = -1; } - else if (strcasecmp ("noop", buf->data) == 0) + else if (mutt_strcasecmp ("noop", buf->data) == 0) km_bindkey (key, menu, OP_NULL); /* the `unbind' command */ else { @@ -840,9 +840,9 @@ int mutt_parse_exec (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) && CurrentMenu != MENU_PAGER) bindings = OpGeneric; - ops[nops] = get_op (bindings, command, strlen(command)); + ops[nops] = get_op (bindings, command, mutt_strlen(command)); if (ops[nops] == OP_NULL && CurrentMenu != MENU_PAGER) - ops[nops] = get_op (OpGeneric, command, strlen(command)); + ops[nops] = get_op (OpGeneric, command, mutt_strlen(command)); if (ops[nops] == OP_NULL) { |