diff options
Diffstat (limited to 'vi.c')
-rw-r--r-- | vi.c | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: vi.c,v 1.43 2012/01/16 14:57:45 christos Exp $ */ +/* $NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vi.c,v 1.43 2012/01/16 14:57:45 christos Exp $"); +__RCSID("$NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -918,34 +918,26 @@ vi_comment_out(EditLine *el, Int c __attribute__((__unused__))) * NB: posix implies that we should enter insert mode, however * this is against historical precedent... */ -#ifdef __weak_reference -__weakref_visible char *my_get_alias_text(const char *) - __weak_reference(get_alias_text); -#endif protected el_action_t /*ARGSUSED*/ vi_alias(EditLine *el, Int c __attribute__((__unused__))) { -#ifdef __weak_reference char alias_name[3]; - char *alias_text; + const char *alias_text; - if (my_get_alias_text == 0) { + if (el->el_chared.c_aliasfun == NULL) return CC_ERROR; - } alias_name[0] = '_'; alias_name[2] = 0; if (el_getc(el, &alias_name[1]) != 1) return CC_ERROR; - alias_text = my_get_alias_text(alias_name); + alias_text = (*el->el_chared.c_aliasfun)(el->el_chared.c_aliasarg, + alias_name); if (alias_text != NULL) FUN(el,push)(el, ct_decode_string(alias_text, &el->el_scratch)); return CC_NORM; -#else - return CC_ERROR; -#endif } /* vi_to_history_line(): |