revert libedit FreeBSD hack, will endeavour to fix properly

This commit is contained in:
Luke Howard
2011-03-22 00:05:37 +11:00
parent c99906eed4
commit 5d773c3d7f
2 changed files with 48 additions and 23 deletions

View File

@@ -918,11 +918,34 @@ vi_comment_out(EditLine *el, Int c)
* 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)
{
#ifdef __weak_reference
char alias_name[3];
char *alias_text;
if (my_get_alias_text == 0) {
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);
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():