16,20c16
< * 3. All advertising materials mentioning features or use of this software
< * must display the following acknowledgement:
< * This product includes software developed by the University of
< * California, Berkeley and its contributors.
< * 4. Neither the name of the University nor the names of its contributors
---
> * 3. Neither the name of the University nor the names of its contributors
36c32
< * $NetBSD: key.c,v 1.11 2001/01/23 15:55:30 jdolecek Exp $
---
> * $NetBSD: key.c,v 1.16 2005/07/06 21:13:02 christos Exp $
43c39
< __FBSDID("$FreeBSD: head/lib/libedit/key.c 108470 2002-12-30 21:18:15Z schweikh $");
---
> __FBSDID("$FreeBSD: head/lib/libedit/key.c 148834 2005-08-07 20:55:59Z stefanf $");
66d61
< #include "sys.h"
89a85
> private void node__free(key_node_t *);
91,92c87,89
< private int node__delete(EditLine *, key_node_t **, char *);
< private int node_lookup(EditLine *, char *, key_node_t *, int);
---
> private int node__delete(EditLine *, key_node_t **, const char *);
> private int node_lookup(EditLine *, const char *, key_node_t *,
> int);
114d110
<
124,125c120
< /* XXX: provide a function to clear the keys */
< el->el_key.map = NULL;
---
> node__free(el->el_key.map);
219c214
< key_clear(EditLine *el, el_action_t *map, char *in)
---
> key_clear(EditLine *el, el_action_t *map, const char *in)
236c231
< key_delete(EditLine *el, char *key)
---
> key_delete(EditLine *el, const char *key)
257c252
< key_print(EditLine *el, char *key)
---
> key_print(EditLine *el, const char *key)
356c351,352
< ptr->val.str = strdup(val->str);
---
> if ((ptr->val.str = el_strdup(val->str)) == NULL)
> return -1;
376c372
< node__delete(EditLine *el, key_node_t **inptr, char *str)
---
> node__delete(EditLine *el, key_node_t **inptr, const char *str)
470a467,475
> private void
> node__free(key_node_t *k)
> {
> if (k == NULL)
> return;
> node__free(k->sibling);
> node__free(k->next);
> el_free((ptr_t) k);
> }
472d476
<
478c482
< node_lookup(EditLine *el, char *str, key_node_t *ptr, int cnt)
---
> node_lookup(EditLine *el, const char *str, key_node_t *ptr, int cnt)
568c572
< key_kprint(EditLine *el, char *key, key_value_t *val, int ntype)
---
> key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
640a645
>
645c650
< key__decode_str(char *str, char *buf, char *sep)
---
> key__decode_str(const char *str, char *buf, const char *sep)
647c652,653
< char *b, *p;
---
> char *b;
> const char *p;
< * 3. All advertising materials mentioning features or use of this software
< * must display the following acknowledgement:
< * This product includes software developed by the University of
< * California, Berkeley and its contributors.
< * 4. Neither the name of the University nor the names of its contributors
---
> * 3. Neither the name of the University nor the names of its contributors
36c32
< * $NetBSD: key.c,v 1.11 2001/01/23 15:55:30 jdolecek Exp $
---
> * $NetBSD: key.c,v 1.16 2005/07/06 21:13:02 christos Exp $
43c39
< __FBSDID("$FreeBSD: head/lib/libedit/key.c 108470 2002-12-30 21:18:15Z schweikh $");
---
> __FBSDID("$FreeBSD: head/lib/libedit/key.c 148834 2005-08-07 20:55:59Z stefanf $");
66d61
< #include "sys.h"
89a85
> private void node__free(key_node_t *);
91,92c87,89
< private int node__delete(EditLine *, key_node_t **, char *);
< private int node_lookup(EditLine *, char *, key_node_t *, int);
---
> private int node__delete(EditLine *, key_node_t **, const char *);
> private int node_lookup(EditLine *, const char *, key_node_t *,
> int);
114d110
<
124,125c120
< /* XXX: provide a function to clear the keys */
< el->el_key.map = NULL;
---
> node__free(el->el_key.map);
219c214
< key_clear(EditLine *el, el_action_t *map, char *in)
---
> key_clear(EditLine *el, el_action_t *map, const char *in)
236c231
< key_delete(EditLine *el, char *key)
---
> key_delete(EditLine *el, const char *key)
257c252
< key_print(EditLine *el, char *key)
---
> key_print(EditLine *el, const char *key)
356c351,352
< ptr->val.str = strdup(val->str);
---
> if ((ptr->val.str = el_strdup(val->str)) == NULL)
> return -1;
376c372
< node__delete(EditLine *el, key_node_t **inptr, char *str)
---
> node__delete(EditLine *el, key_node_t **inptr, const char *str)
470a467,475
> private void
> node__free(key_node_t *k)
> {
> if (k == NULL)
> return;
> node__free(k->sibling);
> node__free(k->next);
> el_free((ptr_t) k);
> }
472d476
<
478c482
< node_lookup(EditLine *el, char *str, key_node_t *ptr, int cnt)
---
> node_lookup(EditLine *el, const char *str, key_node_t *ptr, int cnt)
568c572
< key_kprint(EditLine *el, char *key, key_value_t *val, int ntype)
---
> key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
640a645
>
645c650
< key__decode_str(char *str, char *buf, char *sep)
---
> key__decode_str(const char *str, char *buf, const char *sep)
647c652,653
< char *b, *p;
---
> char *b;
> const char *p;