From 5d773c3d7fabe0b10c0ff0c92d5f39039fa7682b Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 22 Mar 2011 00:05:37 +1100 Subject: [PATCH] revert libedit FreeBSD hack, will endeavour to fix properly --- lib/libedit/config.h.in | 48 +++++++++++++++++++++-------------------- lib/libedit/src/vi.c | 23 ++++++++++++++++++++ 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/lib/libedit/config.h.in b/lib/libedit/config.h.in index 39f803eb6..df59ac317 100644 --- a/lib/libedit/config.h.in +++ b/lib/libedit/config.h.in @@ -200,6 +200,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -217,24 +220,34 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Version number of package */ #undef VERSION /* Define to 1 if you want wide-character code */ #undef WIDECHAR -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - /* Define to 1 if on MINIX. */ #undef _MINIX @@ -245,17 +258,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif - /* Define to empty if `const' does not conform to ANSI C. */ #undef const diff --git a/lib/libedit/src/vi.c b/lib/libedit/src/vi.c index acdc58c42..ee0b97839 100644 --- a/lib/libedit/src/vi.c +++ b/lib/libedit/src/vi.c @@ -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():