diff options
Diffstat (limited to 'cmd-line-utils')
-rw-r--r-- | cmd-line-utils/Makefile.am | 3 | ||||
-rw-r--r-- | cmd-line-utils/libedit/map.c | 2 | ||||
-rw-r--r-- | cmd-line-utils/libedit/terminal.c | 16 | ||||
-rw-r--r-- | cmd-line-utils/libedit/tty.c | 2 | ||||
-rw-r--r-- | cmd-line-utils/readline/Makefile.am | 3 | ||||
-rw-r--r-- | cmd-line-utils/readline/bind.c | 2 | ||||
-rw-r--r-- | cmd-line-utils/readline/chardefs.h | 2 | ||||
-rw-r--r-- | cmd-line-utils/readline/complete.c | 3 | ||||
-rw-r--r-- | cmd-line-utils/readline/config_readline.h | 7 | ||||
-rw-r--r-- | cmd-line-utils/readline/display.c | 12 | ||||
-rw-r--r-- | cmd-line-utils/readline/history.c | 6 | ||||
-rw-r--r-- | cmd-line-utils/readline/readline.c | 15 | ||||
-rw-r--r-- | cmd-line-utils/readline/terminal.c | 3 | ||||
-rw-r--r-- | cmd-line-utils/readline/text.c | 7 | ||||
-rw-r--r-- | cmd-line-utils/readline/xmalloc.c | 2 |
15 files changed, 36 insertions, 49 deletions
diff --git a/cmd-line-utils/Makefile.am b/cmd-line-utils/Makefile.am index 1a84ce7af38..622aa72fd43 100644 --- a/cmd-line-utils/Makefile.am +++ b/cmd-line-utils/Makefile.am @@ -19,6 +19,3 @@ SUBDIRS= @readline_basedir@ DIST_SUBDIRS= libedit readline - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/cmd-line-utils/libedit/map.c b/cmd-line-utils/libedit/map.c index 946bc185437..17b07391b69 100644 --- a/cmd-line-utils/libedit/map.c +++ b/cmd-line-utils/libedit/map.c @@ -1300,7 +1300,7 @@ map_bind(EditLine *el, int argc, const Char **argv) default: (void) fprintf(el->el_errfile, "" FSTR ": Invalid switch `%c'.\n", - argv[0], p[1]); + argv[0], (int) p[1]); } else break; diff --git a/cmd-line-utils/libedit/terminal.c b/cmd-line-utils/libedit/terminal.c index 8cfbeac7c52..fb5600a4140 100644 --- a/cmd-line-utils/libedit/terminal.c +++ b/cmd-line-utils/libedit/terminal.c @@ -908,17 +908,17 @@ terminal_set(EditLine *el, const char *term) terminal_alloc(el, t, NULL); } else { /* auto/magic margins */ - Val(T_am) = tgetflag("am"); - Val(T_xn) = tgetflag("xn"); + Val(T_am) = tgetflag((char*) "am"); + Val(T_xn) = tgetflag((char*) "xn"); /* Can we tab */ - Val(T_pt) = tgetflag("pt"); - Val(T_xt) = tgetflag("xt"); + Val(T_pt) = tgetflag((char*) "pt"); + Val(T_xt) = tgetflag((char*) "xt"); /* do we have a meta? */ - Val(T_km) = tgetflag("km"); - Val(T_MT) = tgetflag("MT"); + Val(T_km) = tgetflag((char*) "km"); + Val(T_MT) = tgetflag((char*) "MT"); /* Get the size */ - Val(T_co) = tgetnum("co"); - Val(T_li) = tgetnum("li"); + Val(T_co) = tgetnum((char*) "co"); + Val(T_li) = tgetnum((char*) "li"); for (t = tstr; t->name != NULL; t++) { /* XXX: some systems' tgetstr needs non const */ terminal_alloc(el, t, tgetstr(strchr(t->name, *t->name), diff --git a/cmd-line-utils/libedit/tty.c b/cmd-line-utils/libedit/tty.c index 46624a87077..eea00bfc245 100644 --- a/cmd-line-utils/libedit/tty.c +++ b/cmd-line-utils/libedit/tty.c @@ -1215,7 +1215,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv) default: (void) fprintf(el->el_errfile, "%s: Unknown switch `%c'.\n", - name, argv[0][1]); + name, (int) argv[0][1]); return -1; } diff --git a/cmd-line-utils/readline/Makefile.am b/cmd-line-utils/readline/Makefile.am index e1e9645e238..39f37ad7453 100644 --- a/cmd-line-utils/readline/Makefile.am +++ b/cmd-line-utils/readline/Makefile.am @@ -32,6 +32,3 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \ EXTRA_DIST= emacs_keymap.c vi_keymap.c DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1 - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index 0ea8b1ca126..7f733abe80c 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -699,7 +699,7 @@ rl_function_of_keyseq (keyseq, map, type) { unsigned char ic = keyseq[i]; - if (META_CHAR_FOR_UCHAR (ic) && _rl_convert_meta_chars_to_ascii) + if (META_CHAR_FOR_UCHAR(ic) && _rl_convert_meta_chars_to_ascii) { if (map[ESC].type == ISKMAP) { diff --git a/cmd-line-utils/readline/chardefs.h b/cmd-line-utils/readline/chardefs.h index 0787d9943bb..a184ab30acb 100644 --- a/cmd-line-utils/readline/chardefs.h +++ b/cmd-line-utils/readline/chardefs.h @@ -59,8 +59,8 @@ #define largest_char 255 /* Largest character value. */ #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) +#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) #define META_CHAR_FOR_UCHAR(c) ((c) > meta_character_threshold) -#define META_CHAR(c) (META_CHAR_FOR_UCHAR(c) && (c) <= largest_char) #define CTRL(c) ((c) & control_character_mask) #define META(c) ((c) | meta_character_bit) diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index d11ea2493a6..a51375cd2b7 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -673,8 +673,7 @@ fnprint (to_print) w = wcwidth (wc); width = (w >= 0) ? w : 1; } - fwrite (s, 1, tlen, rl_outstream); - s += tlen; + s+= fwrite (s, 1, tlen, rl_outstream); printed_len += width; #else putc (*s, rl_outstream); diff --git a/cmd-line-utils/readline/config_readline.h b/cmd-line-utils/readline/config_readline.h index 141989ec3c9..9aa464958bb 100644 --- a/cmd-line-utils/readline/config_readline.h +++ b/cmd-line-utils/readline/config_readline.h @@ -7,6 +7,13 @@ # include <config.h> #endif +#ifdef NOT_YET /* causes problem on MacOSX */ +/* to get wcwidth() defined */ +#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE_EXTENDED +#define _XOPEN_ +#endif + /* Ultrix botches type-ahead when switching from canonical to non-canonical mode, at least through version 4.3 diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 4a9dd466b2f..eb628896d69 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -191,8 +191,6 @@ static int visible_first_line_len; (or is equal to) _rl_screenwidth. */ static int prompt_invis_chars_first_line; -static int prompt_last_screen_line; - static int prompt_physical_chars; /* Variables to save and restore prompt and display information. */ @@ -461,7 +459,7 @@ rl_redisplay () { register int in, out, c, linenum, cursor_linenum; register char *line; - int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int inv_botlin, lb_linenum, o_cpos; int newlines, lpos, temp, modmark; const char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) @@ -675,11 +673,9 @@ rl_redisplay () lpos -= _rl_screenwidth; } - prompt_last_screen_line = newlines; - /* Draw the rest of the line (after the prompt) into invisible_line, keeping track of where the cursor is (cpos_buffer_position), the number of the line containing - the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). + the cursor (lb_linenum), the last line number (inv_botlin). It maintains an array of line breaks for display (inv_lbreaks). This handles expanding tabs for display and displaying meta characters. */ lb_linenum = 0; @@ -862,7 +858,7 @@ rl_redisplay () lb_linenum = newlines; } - inv_botlin = lb_botlin = newlines; + inv_botlin = newlines; CHECK_INV_LBREAKS (); inv_lbreaks[newlines+1] = out; cursor_linenum = lb_linenum; @@ -1893,7 +1889,7 @@ rl_character_len (c, pos) uc = (unsigned char)c; - if (META_CHAR_FOR_UCHAR (uc)) + if (META_CHAR_FOR_UCHAR(uc)) return ((_rl_output_meta_chars == 0) ? 4 : 1); if (uc == '\t') diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c index 5cd5788d1da..c6c46482f50 100644 --- a/cmd-line-utils/readline/history.c +++ b/cmd-line-utils/readline/history.c @@ -211,14 +211,14 @@ history_get (offset) HIST_ENTRY * alloc_history_entry (string, ts) - char *string; + const char *string; char *ts; { HIST_ENTRY *temp; temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); - temp->line = string ? savestring (string) : string; + temp->line = string ? savestring ((char*) string) : (char*) string; temp->data = (char *)NULL; temp->timestamp = ts; @@ -306,7 +306,7 @@ add_history (string) } } - temp = alloc_history_entry (string, hist_inittime ()); + temp = alloc_history_entry ((char*) string, hist_inittime ()); the_history[history_length] = (HIST_ENTRY *)NULL; the_history[history_length - 1] = temp; diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c index 95947551823..d98d7880005 100644 --- a/cmd-line-utils/readline/readline.c +++ b/cmd-line-utils/readline/readline.c @@ -90,7 +90,6 @@ static void bind_arrow_keys_internal PARAMS((Keymap)); static void bind_arrow_keys PARAMS((void)); static void readline_default_bindings PARAMS((void)); -static void reset_default_bindings PARAMS((void)) __attribute__((unused)); static int _rl_subseq_result PARAMS((int, Keymap, int, int)); static int _rl_subseq_getchar PARAMS((int)); @@ -287,7 +286,7 @@ rl_set_prompt (prompt) { FREE (rl_prompt); rl_prompt = prompt ? savestring (prompt) : (char *)NULL; - rl_display_prompt = rl_prompt ? rl_prompt : ""; + rl_display_prompt = rl_prompt ? rl_prompt : (char*) ""; rl_visible_prompt_length = rl_expand_prompt (rl_prompt); return 0; @@ -1071,18 +1070,6 @@ readline_default_bindings () rl_tty_set_default_bindings (_rl_keymap); } -/* Reset the default bindings for the terminal special characters we're - interested in back to rl_insert and read the new ones. */ -static void -reset_default_bindings () -{ - if (_rl_bind_stty_chars) - { - rl_tty_unset_default_bindings (_rl_keymap); - rl_tty_set_default_bindings (_rl_keymap); - } -} - /* Bind some common arrow key sequences in MAP. */ static void bind_arrow_keys_internal (map) diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c index e2785908160..d7c72ca2aa5 100644 --- a/cmd-line-utils/readline/terminal.c +++ b/cmd-line-utils/readline/terminal.c @@ -621,7 +621,8 @@ _rl_output_some_chars (string, count) const char *string; int count; { - fwrite (string, 1, count, _rl_out_stream); + if (fwrite (string, 1, count, _rl_out_stream) != (size_t)count) + fprintf(stderr, "Write failed\n"); } /* Move the cursor back. */ diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index 02b28750c86..75ffd0e482a 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -1168,7 +1168,7 @@ rl_insert_comment (count, key) int rl_comment_len; rl_beg_of_line (1, key); - rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT; + rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT; if (rl_explicit_arg == 0) rl_insert_text (rl_comment_text); @@ -1385,10 +1385,11 @@ rl_transpose_chars (count, key) #if defined (HANDLE_MULTIBYTE) char *dummy; int i; + int prev_point; #else char dummy[2]; #endif - int char_length, prev_point; + int char_length; if (count == 0) return 0; @@ -1407,7 +1408,9 @@ rl_transpose_chars (count, key) count = 1; } +#if defined (HANDLE_MULTIBYTE) prev_point = rl_point; +#endif rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); #if defined (HANDLE_MULTIBYTE) diff --git a/cmd-line-utils/readline/xmalloc.c b/cmd-line-utils/readline/xmalloc.c index cf52da351a8..1a086852552 100644 --- a/cmd-line-utils/readline/xmalloc.c +++ b/cmd-line-utils/readline/xmalloc.c @@ -42,7 +42,7 @@ static void memory_error_and_abort (fname) - char *fname; + const char *fname; { fprintf (stderr, "%s: out of virtual memory\n", fname); exit (2); |