diff --git a/libs/libedit/Makefile.am b/libs/libedit/Makefile.am index 3d95e951a9..eed7a0c583 100644 --- a/libs/libedit/Makefile.am +++ b/libs/libedit/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = src examples doc +SUBDIRS = src ## GENERATED BY SCRIPT - DO NOT EDIT BELOW diff --git a/libs/libedit/src/el.c b/libs/libedit/src/el.c index 8d748f6c2b..eaafcc59de 100644 --- a/libs/libedit/src/el.c +++ b/libs/libedit/src/el.c @@ -522,7 +522,9 @@ el_resize(EditLine *el) sigset_t oset, nset; (void) sigemptyset(&nset); +#ifdef SIGWINCH (void) sigaddset(&nset, SIGWINCH); +#endif (void) sigprocmask(SIG_BLOCK, &nset, &oset); /* get the correct window size */ diff --git a/libs/libedit/src/sig.c b/libs/libedit/src/sig.c index cec4319119..4536d9ce82 100644 --- a/libs/libedit/src/sig.c +++ b/libs/libedit/src/sig.c @@ -83,9 +83,11 @@ sig_handler(int signo) term__flush(); break; +#ifdef SIGWINCH case SIGWINCH: el_resize(sel); break; +#endif default: tty_cookedmode(sel); diff --git a/libs/libedit/src/sig.h b/libs/libedit/src/sig.h index 0bf1fc37e3..877370e36e 100644 --- a/libs/libedit/src/sig.h +++ b/libs/libedit/src/sig.h @@ -48,6 +48,7 @@ * Define here all the signals we are going to handle * The _DO macro is used to iterate in the source code */ +#ifdef SIGWINCH #define ALLSIGS \ _DO(SIGINT) \ _DO(SIGTSTP) \ @@ -57,6 +58,16 @@ _DO(SIGTERM) \ _DO(SIGCONT) \ _DO(SIGWINCH) +#else +#define ALLSIGS \ + _DO(SIGINT) \ + _DO(SIGTSTP) \ + _DO(SIGSTOP) \ + _DO(SIGQUIT) \ + _DO(SIGHUP) \ + _DO(SIGTERM) \ + _DO(SIGCONT) +#endif typedef void (*el_signalhandler_t)(int); typedef el_signalhandler_t *el_signal_t; diff --git a/libs/libedit/src/term.c b/libs/libedit/src/term.c index 34e4b23e53..5fca915f66 100644 --- a/libs/libedit/src/term.c +++ b/libs/libedit/src/term.c @@ -905,7 +905,9 @@ term_set(EditLine *el, const char *term) int lins, cols; (void) sigemptyset(&nset); +#ifdef SIGWINCH (void) sigaddset(&nset, SIGWINCH); +#endif (void) sigprocmask(SIG_BLOCK, &nset, &oset); area = buf; diff --git a/libs/libedit/src/unvis.c b/libs/libedit/src/unvis.c index 31bf3e54a6..fce2216c57 100644 --- a/libs/libedit/src/unvis.c +++ b/libs/libedit/src/unvis.c @@ -63,7 +63,7 @@ __weak_alias(strunvis,_strunvis) #define S_HEX1 7 /* hex digit */ #define S_HEX2 8 /* hex digit 2 */ -#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') +#define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7') #define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10)) /* diff --git a/libs/libedit/src/vi.c b/libs/libedit/src/vi.c index 5107bd2ec1..bb408d329c 100644 --- a/libs/libedit/src/vi.c +++ b/libs/libedit/src/vi.c @@ -915,14 +915,14 @@ 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 +#if defined(__weak_reference) && !defined(__FreeBSD__) extern char *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 +#if defined(__weak_reference) && !defined(__FreeBSD__) char alias_name[3]; char *alias_text; diff --git a/libs/libedit/src/vis.c b/libs/libedit/src/vis.c index 0ad9c60891..6148f42e3d 100644 --- a/libs/libedit/src/vis.c +++ b/libs/libedit/src/vis.c @@ -106,7 +106,7 @@ __weak_alias(vis,_vis) #undef BELL #define BELL '\a' -#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') +#define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7') #define iswhite(c) (c == ' ' || c == '\t' || c == '\n') #define issafe(c) (c == '\b' || c == BELL || c == '\r') #define xtoa(c) "0123456789abcdef"[c] @@ -208,8 +208,8 @@ do { \ } \ if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \ *dst++ = '\\'; \ - *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0'; \ - *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0'; \ + *dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 6) & 03) + '0'; \ + *dst++ = (unsigned char)(((u_int32_t)(unsigned char)c >> 3) & 07) + '0'; \ *dst++ = (c & 07) + '0'; \ } else { \ if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \