Merge from 5.0

This commit is contained in:
Staale Smedseng 2009-06-29 16:00:47 +02:00
commit db1591a7a2
36 changed files with 246 additions and 216 deletions

View File

@ -2004,7 +2004,7 @@ static COMMANDS *find_command(char *name,char cmd_char)
(uchar*)commands[i].name,len) && (uchar*)commands[i].name,len) &&
!commands[i].name[len] && !commands[i].name[len] &&
(!end || (end && commands[i].takes_params))) || (!end || (end && commands[i].takes_params))) ||
!name && commands[i].cmd_char == cmd_char)) (!name && commands[i].cmd_char == cmd_char)))
{ {
DBUG_PRINT("exit",("found command: %s", commands[i].name)); DBUG_PRINT("exit",("found command: %s", commands[i].name));
DBUG_RETURN(&commands[i]); DBUG_RETURN(&commands[i]);
@ -2163,7 +2163,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
buffer.length(0); buffer.length(0);
} }
else if (!*ml_comment && (!*in_string && (inchar == '#' || else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' && (inchar == '-' && pos[1] == '-' &&
/* /*
The third byte is either whitespace or is the The third byte is either whitespace or is the
end of the line -- which would occur only end of the line -- which would occur only
@ -2171,7 +2171,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
itself whitespace and should also match. itself whitespace and should also match.
*/ */
(my_isspace(charset_info,pos[2]) || (my_isspace(charset_info,pos[2]) ||
!pos[2])))) !pos[2])))))
{ {
// Flush previously accepted characters // Flush previously accepted characters
if (out != line) if (out != line)

View File

@ -689,8 +689,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Format events are not concerned by --offset and such, we always need to Format events are not concerned by --offset and such, we always need to
read them to be able to process the wanted events. read them to be able to process the wanted events.
*/ */
if ((rec_count >= offset) && if (((rec_count >= offset) &&
((my_time_t)(ev->when) >= start_datetime) || ((my_time_t)(ev->when) >= start_datetime)) ||
(ev_type == FORMAT_DESCRIPTION_EVENT)) (ev_type == FORMAT_DESCRIPTION_EVENT))
{ {
if (ev_type != FORMAT_DESCRIPTION_EVENT) if (ev_type != FORMAT_DESCRIPTION_EVENT)

View File

@ -79,7 +79,7 @@ static int _rl_read_init_file PARAMS((const char *, int));
static int glean_key_from_name PARAMS((char *)); static int glean_key_from_name PARAMS((char *));
static int find_boolean_var PARAMS((const char *)); static int find_boolean_var PARAMS((const char *));
static char *_rl_get_string_variable_value PARAMS((const char *)); static const char *_rl_get_string_variable_value PARAMS((const char *));
static int substring_member_of_array PARAMS((char *, const char **)); static int substring_member_of_array PARAMS((char *, const char **));
static int currently_reading_init_file; static int currently_reading_init_file;
@ -442,7 +442,7 @@ rl_translate_keyseq (seq, array, len)
{ {
register int i, c, l, temp; register int i, c, l, temp;
for (i = l = 0; c = seq[i]; i++) for (i = l = 0; (c = seq[i]); i++)
{ {
if (c == '\\') if (c == '\\')
{ {
@ -776,7 +776,8 @@ _rl_read_file (filename, sizep)
file_size = (size_t)finfo.st_size; file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */ /* check for overflow on very large files */
if (file_size != finfo.st_size || file_size + 1 < file_size) if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
file_size + 1 < file_size)
{ {
if (file >= 0) if (file >= 0)
close (file); close (file);
@ -807,7 +808,7 @@ _rl_read_file (filename, sizep)
/* Re-read the current keybindings file. */ /* Re-read the current keybindings file. */
int int
rl_re_read_init_file (count, ignore) rl_re_read_init_file (count, ignore)
int count, ignore; int count __attribute__((unused)), ignore __attribute__((unused));
{ {
int r; int r;
r = rl_read_init_file ((const char *)NULL); r = rl_read_init_file ((const char *)NULL);
@ -1031,7 +1032,7 @@ parser_if (args)
/* Invert the current parser state if there is anything on the stack. */ /* Invert the current parser state if there is anything on the stack. */
static int static int
parser_else (args) parser_else (args)
char *args; char *args __attribute__((unused));
{ {
register int i; register int i;
@ -1062,7 +1063,7 @@ parser_else (args)
_rl_parsing_conditionalized_out from the stack. */ _rl_parsing_conditionalized_out from the stack. */
static int static int
parser_endif (args) parser_endif (args)
char *args; char *args __attribute__((unused));
{ {
if (if_stack_depth) if (if_stack_depth)
_rl_parsing_conditionalized_out = if_stack[--if_stack_depth]; _rl_parsing_conditionalized_out = if_stack[--if_stack_depth];
@ -1185,7 +1186,7 @@ rl_parse_and_bind (string)
{ {
int passc = 0; int passc = 0;
for (i = 1; c = string[i]; i++) for (i = 1; (c = string[i]); i++)
{ {
if (passc) if (passc)
{ {
@ -1276,7 +1277,7 @@ rl_parse_and_bind (string)
int delimiter, passc; int delimiter, passc;
delimiter = string[i++]; delimiter = string[i++];
for (passc = 0; c = string[i]; i++) for (passc = 0; (c = string[i]); i++)
{ {
if (passc) if (passc)
{ {
@ -1436,7 +1437,7 @@ static struct {
#if defined (VISIBLE_STATS) #if defined (VISIBLE_STATS)
{ "visible-stats", &rl_visible_stats, 0 }, { "visible-stats", &rl_visible_stats, 0 },
#endif /* VISIBLE_STATS */ #endif /* VISIBLE_STATS */
{ (char *)NULL, (int *)NULL } { (char *)NULL, (int *)NULL, 0 }
}; };
static int static int
@ -1505,7 +1506,7 @@ static struct {
{ "editing-mode", V_STRING, sv_editmode }, { "editing-mode", V_STRING, sv_editmode },
{ "isearch-terminators", V_STRING, sv_isrchterm }, { "isearch-terminators", V_STRING, sv_isrchterm },
{ "keymap", V_STRING, sv_keymap }, { "keymap", V_STRING, sv_keymap },
{ (char *)NULL, 0 } { (char *)NULL, 0, (_rl_sv_func_t*)NULL }
}; };
static int static int
@ -1532,7 +1533,7 @@ bool_to_int (value)
(value[0] == '1' && value[1] == '\0')); (value[0] == '1' && value[1] == '\0'));
} }
char * const char *
rl_variable_value (name) rl_variable_value (name)
const char *name; const char *name;
{ {
@ -1799,7 +1800,7 @@ rl_set_keymap_from_edit_mode ()
#endif /* VI_MODE */ #endif /* VI_MODE */
} }
char * const char *
rl_get_keymap_name_from_edit_mode () rl_get_keymap_name_from_edit_mode ()
{ {
if (rl_editing_mode == emacs_mode) if (rl_editing_mode == emacs_mode)
@ -2048,7 +2049,7 @@ rl_function_dumper (print_readably)
fprintf (rl_outstream, "\n"); fprintf (rl_outstream, "\n");
for (i = 0; name = names[i]; i++) for (i = 0; (name = names[i]); i++)
{ {
rl_command_func_t *function; rl_command_func_t *function;
char **invokers; char **invokers;
@ -2108,7 +2109,7 @@ rl_function_dumper (print_readably)
the output in such a way that it can be read back in. */ the output in such a way that it can be read back in. */
int int
rl_dump_functions (count, key) rl_dump_functions (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
if (rl_dispatching) if (rl_dispatching)
fprintf (rl_outstream, "\r\n"); fprintf (rl_outstream, "\r\n");
@ -2188,7 +2189,7 @@ rl_macro_dumper (print_readably)
int int
rl_dump_macros (count, key) rl_dump_macros (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
if (rl_dispatching) if (rl_dispatching)
fprintf (rl_outstream, "\r\n"); fprintf (rl_outstream, "\r\n");
@ -2197,12 +2198,13 @@ rl_dump_macros (count, key)
return (0); return (0);
} }
static char * static const char *
_rl_get_string_variable_value (name) _rl_get_string_variable_value (name)
const char *name; const char *name;
{ {
static char numbuf[32]; static char numbuf[32];
char *ret; const char *ret;
char *tmp;
if (_rl_stricmp (name, "bell-style") == 0) if (_rl_stricmp (name, "bell-style") == 0)
{ {
@ -2230,11 +2232,11 @@ _rl_get_string_variable_value (name)
{ {
if (_rl_isearch_terminators == 0) if (_rl_isearch_terminators == 0)
return 0; return 0;
ret = _rl_untranslate_macro_value (_rl_isearch_terminators); tmp = _rl_untranslate_macro_value (_rl_isearch_terminators);
if (ret) if (tmp)
{ {
strncpy (numbuf, ret, sizeof (numbuf) - 1); strncpy (numbuf, tmp, sizeof (numbuf) - 1);
free (ret); free (tmp);
numbuf[sizeof(numbuf) - 1] = '\0'; numbuf[sizeof(numbuf) - 1] = '\0';
} }
else else
@ -2257,7 +2259,7 @@ rl_variable_dumper (print_readably)
int print_readably; int print_readably;
{ {
int i; int i;
char *v; const char *v;
for (i = 0; boolean_varlist[i].name; i++) for (i = 0; boolean_varlist[i].name; i++)
{ {
@ -2286,7 +2288,7 @@ rl_variable_dumper (print_readably)
the output in such a way that it can be read back in. */ the output in such a way that it can be read back in. */
int int
rl_dump_variables (count, key) rl_dump_variables (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
if (rl_dispatching) if (rl_dispatching)
fprintf (rl_outstream, "\r\n"); fprintf (rl_outstream, "\r\n");

View File

@ -359,14 +359,14 @@ rl_complete (ignore, invoking_key)
/* List the possible completions. See description of rl_complete (). */ /* List the possible completions. See description of rl_complete (). */
int int
rl_possible_completions (ignore, invoking_key) rl_possible_completions (ignore, invoking_key)
int ignore, invoking_key; int ignore __attribute__((unused)), invoking_key __attribute__((unused));
{ {
return (rl_complete_internal ('?')); return (rl_complete_internal ('?'));
} }
int int
rl_insert_completions (ignore, invoking_key) rl_insert_completions (ignore, invoking_key)
int ignore, invoking_key; int ignore __attribute__((unused)), invoking_key __attribute__((unused));
{ {
return (rl_complete_internal ('*')); return (rl_complete_internal ('*'));
} }
@ -696,7 +696,8 @@ print_filename (to_print, full_pathname)
char *to_print, *full_pathname; char *to_print, *full_pathname;
{ {
int printed_len, extension_char, slen, tlen; int printed_len, extension_char, slen, tlen;
char *s, c, *new_full_pathname, *dn; char *s, c, *new_full_pathname;
const char *dn;
extension_char = 0; extension_char = 0;
printed_len = fnprint (to_print); printed_len = fnprint (to_print);
@ -783,7 +784,7 @@ print_filename (to_print, full_pathname)
static char * static char *
rl_quote_filename (s, rtype, qcp) rl_quote_filename (s, rtype, qcp)
char *s; char *s;
int rtype; int rtype __attribute__((unused));
char *qcp; char *qcp;
{ {
char *r; char *r;
@ -884,7 +885,7 @@ _rl_find_completion_word (fp, dp)
/* We didn't find an unclosed quoted substring upon which to do /* We didn't find an unclosed quoted substring upon which to do
completion, so use the word break characters to find the completion, so use the word break characters to find the
substring on which to complete. */ substring on which to complete. */
while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
{ {
scan = rl_line_buffer[rl_point]; scan = rl_line_buffer[rl_point];
@ -1803,7 +1804,7 @@ rl_completion_matches (text, entry_function)
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
match_list[1] = (char *)NULL; match_list[1] = (char *)NULL;
while (string = (*entry_function) (text, matches)) while ((string = (*entry_function) (text, matches)))
{ {
if (matches + 1 == match_list_size) if (matches + 1 == match_list_size)
match_list = (char **)xrealloc match_list = (char **)xrealloc
@ -2111,7 +2112,7 @@ rl_filename_completion_function (text, state)
ring the bell, and reset the counter to zero. */ ring the bell, and reset the counter to zero. */
int int
rl_menu_complete (count, ignore) rl_menu_complete (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
rl_compentry_func_t *our_func; rl_compentry_func_t *our_func;
int matching_filenames, found_quote; int matching_filenames, found_quote;

View File

@ -127,7 +127,7 @@ int _rl_want_redisplay = 0;
/* The stuff that gets printed out before the actual text of the line. /* The stuff that gets printed out before the actual text of the line.
This is usually pointing to rl_prompt. */ This is usually pointing to rl_prompt. */
char *rl_display_prompt = (char *)NULL; const char *rl_display_prompt = (const char *)NULL;
/* Pseudo-global variables declared here. */ /* Pseudo-global variables declared here. */
@ -229,7 +229,10 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
int *lp, *lip, *niflp, *vlp; int *lp, *lip, *niflp, *vlp;
{ {
char *r, *ret, *p, *igstart; char *r, *ret, *p, *igstart;
int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; int l, rl, last, ignoring, ninvis, invfl, invflset, physchars;
#if defined (HANDLE_MULTIBYTE)
int ind, pind;
#endif
/* Short-circuit if we can. */ /* Short-circuit if we can. */
if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0) if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0)
@ -242,7 +245,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
if (niflp) if (niflp)
*niflp = 0; *niflp = 0;
if (vlp) if (vlp)
*vlp = lp ? *lp : strlen (r); *vlp = lp ? *lp : (int)strlen (r);
return r; return r;
} }
@ -459,9 +462,10 @@ rl_redisplay ()
register int in, out, c, linenum, cursor_linenum; register int in, out, c, linenum, cursor_linenum;
register char *line; register char *line;
int inv_botlin, lb_botlin, lb_linenum, o_cpos; int inv_botlin, lb_botlin, lb_linenum, o_cpos;
int newlines, lpos, temp, modmark, n0, num; int newlines, lpos, temp, modmark;
char *prompt_this_line; const char *prompt_this_line;
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
int num, n0;
wchar_t wc; wchar_t wc;
size_t wc_bytes; size_t wc_bytes;
int wc_width; int wc_width;
@ -626,7 +630,6 @@ rl_redisplay ()
contents of the command line? */ contents of the command line? */
while (lpos >= _rl_screenwidth) while (lpos >= _rl_screenwidth)
{ {
int z;
/* fix from Darin Johnson <darin@acuson.com> for prompt string with /* fix from Darin Johnson <darin@acuson.com> for prompt string with
invisible characters that is longer than the screen width. The invisible characters that is longer than the screen width. The
prompt_invis_chars_first_line variable could be made into an array prompt_invis_chars_first_line variable could be made into an array
@ -635,6 +638,7 @@ rl_redisplay ()
prompts that exceed two physical lines? prompts that exceed two physical lines?
Additional logic fix from Edward Catmur <ed@catmur.co.uk> */ Additional logic fix from Edward Catmur <ed@catmur.co.uk> */
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
int z;
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{ {
n0 = num; n0 = num;
@ -878,6 +882,7 @@ rl_redisplay ()
if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up)
{ {
int nleft, pos, changed_screen_line, tx; int nleft, pos, changed_screen_line, tx;
char empty_str[1] = { 0 };
if (!rl_display_fixed || forced_display) if (!rl_display_fixed || forced_display)
{ {
@ -902,7 +907,7 @@ rl_redisplay ()
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l])) #define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l]) #define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
#define VIS_CHARS(line) (visible_line + vis_lbreaks[line]) #define VIS_CHARS(line) (visible_line + vis_lbreaks[line])
#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line) #define VIS_LINE(line) ((line) > _rl_vis_botlin) ? empty_str : VIS_CHARS(line)
#define INV_LINE(line) (invisible_line + inv_lbreaks[line]) #define INV_LINE(line) (invisible_line + inv_lbreaks[line])
/* For each line in the buffer, do the updating display. */ /* For each line in the buffer, do the updating display. */
@ -969,7 +974,7 @@ rl_redisplay ()
_rl_move_vert (linenum); _rl_move_vert (linenum);
_rl_move_cursor_relative (0, tt); _rl_move_cursor_relative (0, tt);
_rl_clear_to_eol _rl_clear_to_eol
((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth); ((linenum == _rl_vis_botlin) ? (int)strlen (tt) : _rl_screenwidth);
} }
} }
_rl_vis_botlin = inv_botlin; _rl_vis_botlin = inv_botlin;
@ -2261,7 +2266,7 @@ static void
redraw_prompt (t) redraw_prompt (t)
char *t; char *t;
{ {
char *oldp; const char *oldp;
oldp = rl_display_prompt; oldp = rl_display_prompt;
rl_save_prompt (); rl_save_prompt ();

View File

@ -87,14 +87,14 @@ char history_comment_char = '\0';
/* The list of characters which inhibit the expansion of text if found /* The list of characters which inhibit the expansion of text if found
immediately following history_expansion_char. */ immediately following history_expansion_char. */
char *history_no_expand_chars = " \t\n\r="; const char *history_no_expand_chars = " \t\n\r=";
/* If set to a non-zero value, single quotes inhibit history expansion. /* If set to a non-zero value, single quotes inhibit history expansion.
The default is 0. */ The default is 0. */
int history_quotes_inhibit_expansion = 0; int history_quotes_inhibit_expansion = 0;
/* Used to split words by history_tokenize_internal. */ /* Used to split words by history_tokenize_internal. */
char *history_word_delimiters = HISTORY_WORD_DELIMITERS; const char *history_word_delimiters = HISTORY_WORD_DELIMITERS;
/* If set, this points to a function that is called to verify that a /* If set, this points to a function that is called to verify that a
particular history expansion should be performed. */ particular history expansion should be performed. */
@ -203,7 +203,7 @@ get_history_event (string, caller_index, delimiting_quote)
} }
/* Only a closing `?' or a newline delimit a substring search string. */ /* Only a closing `?' or a newline delimit a substring search string. */
for (local_index = i; c = string[i]; i++) for (local_index = i; (c = string[i]); i++)
{ {
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)

View File

@ -186,7 +186,8 @@ read_history_range (filename, from, to)
file_size = (size_t)finfo.st_size; file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */ /* check for overflow on very large files */
if (file_size != finfo.st_size || file_size + 1 < file_size) if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
file_size + 1 < file_size)
{ {
errno = overflow_errno; errno = overflow_errno;
goto error_and_exit; goto error_and_exit;
@ -339,7 +340,8 @@ history_truncate_file (fname, lines)
file_size = (size_t)finfo.st_size; file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */ /* check for overflow on very large files */
if (file_size != finfo.st_size || file_size + 1 < file_size) if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
file_size + 1 < file_size)
{ {
close (file); close (file);
#if defined (EFBIG) #if defined (EFBIG)

View File

@ -243,9 +243,9 @@ extern int history_length;
extern int history_max_entries; extern int history_max_entries;
extern char history_expansion_char; extern char history_expansion_char;
extern char history_subst_char; extern char history_subst_char;
extern char *history_word_delimiters; extern const char *history_word_delimiters;
extern char history_comment_char; extern char history_comment_char;
extern char *history_no_expand_chars; extern const char *history_no_expand_chars;
extern char *history_search_delimiter_chars; extern char *history_search_delimiter_chars;
extern int history_quotes_inhibit_expansion; extern int history_quotes_inhibit_expansion;

View File

@ -420,7 +420,7 @@ rl_read_key ()
else else
{ {
/* If input is coming from a macro, then use that. */ /* If input is coming from a macro, then use that. */
if (c = _rl_next_macro_key ()) if ((c = _rl_next_macro_key ()))
return (c); return (c);
/* If the user has an event function, then call it periodically. */ /* If the user has an event function, then call it periodically. */

View File

@ -75,7 +75,7 @@ static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int));
static char *last_isearch_string; static char *last_isearch_string;
static int last_isearch_string_len; static int last_isearch_string_len;
static char *default_isearch_terminators = "\033\012"; static const char *default_isearch_terminators = "\033\012";
_rl_search_cxt * _rl_search_cxt *
_rl_scxt_alloc (type, flags) _rl_scxt_alloc (type, flags)
@ -119,7 +119,7 @@ _rl_scxt_alloc (type, flags)
void void
_rl_scxt_dispose (cxt, flags) _rl_scxt_dispose (cxt, flags)
_rl_search_cxt *cxt; _rl_search_cxt *cxt;
int flags; int flags __attribute__((unused));
{ {
FREE (cxt->search_string); FREE (cxt->search_string);
FREE (cxt->allocated_line); FREE (cxt->allocated_line);
@ -154,7 +154,7 @@ rl_forward_search_history (sign, key)
static void static void
rl_display_search (search_string, reverse_p, where) rl_display_search (search_string, reverse_p, where)
char *search_string; char *search_string;
int reverse_p, where; int reverse_p, where __attribute__((unused));
{ {
char *message; char *message;
int msglen, searchlen; int msglen, searchlen;
@ -614,7 +614,7 @@ _rl_isearch_cleanup (cxt, r)
backwards. */ backwards. */
static int static int
rl_search_history (direction, invoking_key) rl_search_history (direction, invoking_key)
int direction, invoking_key; int direction, invoking_key __attribute__((unused));
{ {
_rl_search_cxt *cxt; /* local for now, but saved globally */ _rl_search_cxt *cxt; /* local for now, but saved globally */
int c, r; int c, r;

View File

@ -79,7 +79,7 @@ static int rl_yank_nth_arg_internal PARAMS((int, int, int));
of kill material. */ of kill material. */
int int
rl_set_retained_kills (num) rl_set_retained_kills (num)
int num; int num __attribute__((unused));
{ {
return 0; return 0;
} }
@ -296,7 +296,7 @@ rl_backward_kill_line (direction, ignore)
/* Kill the whole line, no matter where point is. */ /* Kill the whole line, no matter where point is. */
int int
rl_kill_full_line (count, ignore) rl_kill_full_line (count, ignore)
int count, ignore; int count __attribute__((unused)), ignore __attribute__((unused));
{ {
rl_begin_undo_group (); rl_begin_undo_group ();
rl_point = 0; rl_point = 0;
@ -314,7 +314,7 @@ rl_kill_full_line (count, ignore)
using behaviour that they expect. */ using behaviour that they expect. */
int int
rl_unix_word_rubout (count, key) rl_unix_word_rubout (count, key)
int count, key; int count, key __attribute__((unused));
{ {
int orig_point; int orig_point;
@ -347,7 +347,7 @@ rl_unix_word_rubout (count, key)
deletes backward to directory separator (`/') or whitespace. */ deletes backward to directory separator (`/') or whitespace. */
int int
rl_unix_filename_rubout (count, key) rl_unix_filename_rubout (count, key)
int count, key; int count, key __attribute__((unused));
{ {
int orig_point, c; int orig_point, c;
@ -391,7 +391,7 @@ rl_unix_filename_rubout (count, key)
doing. */ doing. */
int int
rl_unix_line_discard (count, key) rl_unix_line_discard (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
if (rl_point == 0) if (rl_point == 0)
rl_ding (); rl_ding ();
@ -428,7 +428,7 @@ region_kill_internal (delete)
/* Copy the text in the region to the kill ring. */ /* Copy the text in the region to the kill ring. */
int int
rl_copy_region_to_kill (count, ignore) rl_copy_region_to_kill (count, ignore)
int count, ignore; int count __attribute__((unused)), ignore __attribute__((unused));
{ {
return (region_kill_internal (0)); return (region_kill_internal (0));
} }
@ -436,7 +436,7 @@ rl_copy_region_to_kill (count, ignore)
/* Kill the text between the point and mark. */ /* Kill the text between the point and mark. */
int int
rl_kill_region (count, ignore) rl_kill_region (count, ignore)
int count, ignore; int count __attribute__((unused)), ignore __attribute__((unused));
{ {
int r, npoint; int r, npoint;
@ -501,7 +501,7 @@ rl_copy_backward_word (count, key)
/* Yank back the last killed text. This ignores arguments. */ /* Yank back the last killed text. This ignores arguments. */
int int
rl_yank (count, ignore) rl_yank (count, ignore)
int count, ignore; int count __attribute__((unused)), ignore __attribute__((unused));
{ {
if (rl_kill_ring == 0) if (rl_kill_ring == 0)
{ {
@ -520,7 +520,7 @@ rl_yank (count, ignore)
yank back some other text. */ yank back some other text. */
int int
rl_yank_pop (count, key) rl_yank_pop (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
int l, n; int l, n;

View File

@ -201,7 +201,7 @@ _rl_kill_kbd_macro ()
re-executing the existing macro. */ re-executing the existing macro. */
int int
rl_start_kbd_macro (ignore1, ignore2) rl_start_kbd_macro (ignore1, ignore2)
int ignore1, ignore2; int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
{ {
if (RL_ISSTATE (RL_STATE_MACRODEF)) if (RL_ISSTATE (RL_STATE_MACRODEF))
{ {
@ -226,7 +226,7 @@ rl_start_kbd_macro (ignore1, ignore2)
that many times, counting the definition as the first time. */ that many times, counting the definition as the first time. */
int int
rl_end_kbd_macro (count, ignore) rl_end_kbd_macro (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
if (RL_ISSTATE (RL_STATE_MACRODEF) == 0) if (RL_ISSTATE (RL_STATE_MACRODEF) == 0)
{ {
@ -246,7 +246,7 @@ rl_end_kbd_macro (count, ignore)
COUNT says how many times to execute it. */ COUNT says how many times to execute it. */
int int
rl_call_last_kbd_macro (count, ignore) rl_call_last_kbd_macro (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
if (current_macro == 0) if (current_macro == 0)
_rl_abort_internal (); _rl_abort_internal ();

View File

@ -346,8 +346,8 @@ _rl_char_value (buf, ind)
#undef _rl_find_next_mbchar #undef _rl_find_next_mbchar
int int
_rl_find_next_mbchar (string, seed, count, flags) _rl_find_next_mbchar (string, seed, count, flags)
char *string; char *string __attribute__((unused));
int seed, count, flags; int seed, count, flags __attribute__((unused));
{ {
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
return _rl_find_next_mbchar_internal (string, seed, count, flags); return _rl_find_next_mbchar_internal (string, seed, count, flags);
@ -362,8 +362,8 @@ _rl_find_next_mbchar (string, seed, count, flags)
#undef _rl_find_prev_mbchar #undef _rl_find_prev_mbchar
int int
_rl_find_prev_mbchar (string, seed, flags) _rl_find_prev_mbchar (string, seed, flags)
char *string; char *string __attribute__((unused));
int seed, flags; int seed, flags __attribute__((unused));
{ {
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
return _rl_find_prev_mbchar_internal (string, seed, flags); return _rl_find_prev_mbchar_internal (string, seed, flags);

View File

@ -228,7 +228,7 @@ _rl_reset_argument ()
/* Start a numeric argument with initial value KEY */ /* Start a numeric argument with initial value KEY */
int int
rl_digit_argument (ignore, key) rl_digit_argument (ignore, key)
int ignore, key; int ignore __attribute__((unused)), key;
{ {
_rl_arg_init (); _rl_arg_init ();
if (RL_ISSTATE (RL_STATE_CALLBACK)) if (RL_ISSTATE (RL_STATE_CALLBACK))
@ -249,7 +249,7 @@ rl_digit_argument (ignore, key)
dispatch on it. If the key is the abort character then abort. */ dispatch on it. If the key is the abort character then abort. */
int int
rl_universal_argument (count, key) rl_universal_argument (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
_rl_arg_init (); _rl_arg_init ();
rl_numeric_arg *= 4; rl_numeric_arg *= 4;
@ -413,7 +413,7 @@ _rl_history_set_point ()
void void
rl_replace_from_history (entry, flags) rl_replace_from_history (entry, flags)
HIST_ENTRY *entry; HIST_ENTRY *entry;
int flags; /* currently unused */ int flags __attribute__((unused)); /* currently unused */
{ {
/* Can't call with `1' because rl_undo_list might point to an undo list /* Can't call with `1' because rl_undo_list might point to an undo list
from a history entry, just like we're setting up here. */ from a history entry, just like we're setting up here. */
@ -440,7 +440,7 @@ rl_replace_from_history (entry, flags)
/* Meta-< goes to the start of the history. */ /* Meta-< goes to the start of the history. */
int int
rl_beginning_of_history (count, key) rl_beginning_of_history (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
return (rl_get_previous_history (1 + where_history (), key)); return (rl_get_previous_history (1 + where_history (), key));
} }
@ -448,7 +448,7 @@ rl_beginning_of_history (count, key)
/* Meta-> goes to the end of the history. (The current line). */ /* Meta-> goes to the end of the history. (The current line). */
int int
rl_end_of_history (count, key) rl_end_of_history (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
rl_maybe_replace_line (); rl_maybe_replace_line ();
using_history (); using_history ();
@ -553,7 +553,7 @@ rl_get_previous_history (count, key)
/* How to toggle back and forth between editing modes. */ /* How to toggle back and forth between editing modes. */
int int
rl_vi_editing_mode (count, key) rl_vi_editing_mode (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
#if defined (VI_MODE) #if defined (VI_MODE)
_rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */ _rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */
@ -566,7 +566,7 @@ rl_vi_editing_mode (count, key)
int int
rl_emacs_editing_mode (count, key) rl_emacs_editing_mode (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
rl_editing_mode = emacs_mode; rl_editing_mode = emacs_mode;
_rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */ _rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */
@ -577,7 +577,7 @@ rl_emacs_editing_mode (count, key)
/* Function for the rest of the library to use to set insert/overwrite mode. */ /* Function for the rest of the library to use to set insert/overwrite mode. */
void void
_rl_set_insert_mode (im, force) _rl_set_insert_mode (im, force)
int im, force; int im, force __attribute__((unused));
{ {
#ifdef CURSOR_MODE #ifdef CURSOR_MODE
_rl_set_cursor (im, force); _rl_set_cursor (im, force);
@ -590,7 +590,7 @@ _rl_set_insert_mode (im, force)
mode. A negative or zero explicit argument selects insert mode. */ mode. A negative or zero explicit argument selects insert mode. */
int int
rl_overwrite_mode (count, key) rl_overwrite_mode (count, key)
int count, key; int count, key __attribute__((unused));
{ {
if (rl_explicit_arg == 0) if (rl_explicit_arg == 0)
_rl_set_insert_mode (rl_insert_mode ^ 1, 0); _rl_set_insert_mode (rl_insert_mode ^ 1, 0);

View File

@ -101,7 +101,8 @@ _rl_init_eightbit ()
/* If we have setlocale(3), just check the current LC_CTYPE category /* If we have setlocale(3), just check the current LC_CTYPE category
value, and go into eight-bit mode if it's not C or POSIX. */ value, and go into eight-bit mode if it's not C or POSIX. */
#if defined (HAVE_SETLOCALE) #if defined (HAVE_SETLOCALE)
char *lspec, *t; const char *lspec;
char *t;
/* Set the LC_CTYPE locale category from environment variables. */ /* Set the LC_CTYPE locale category from environment variables. */
lspec = _rl_get_locale_var ("LC_CTYPE"); lspec = _rl_get_locale_var ("LC_CTYPE");
@ -127,7 +128,8 @@ _rl_init_eightbit ()
return (0); return (0);
#else /* !HAVE_SETLOCALE */ #else /* !HAVE_SETLOCALE */
char *lspec, *t; const char *lspec;
char *t;
int i; int i;
/* We don't have setlocale. Finesse it. Check the environment for the /* We don't have setlocale. Finesse it. Check the environment for the

View File

@ -90,7 +90,7 @@ static void bind_arrow_keys_internal PARAMS((Keymap));
static void bind_arrow_keys PARAMS((void)); static void bind_arrow_keys PARAMS((void));
static void readline_default_bindings PARAMS((void)); static void readline_default_bindings PARAMS((void));
static void reset_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_result PARAMS((int, Keymap, int, int));
static int _rl_subseq_getchar PARAMS((int)); static int _rl_subseq_getchar PARAMS((int));

View File

@ -304,7 +304,7 @@ extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *))
extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap)); extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap)); extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
extern char *rl_variable_value PARAMS((const char *)); extern const char *rl_variable_value PARAMS((const char *));
extern int rl_variable_bind PARAMS((const char *, const char *)); extern int rl_variable_bind PARAMS((const char *, const char *));
/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */ /* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
@ -343,7 +343,7 @@ extern void rl_set_keymap PARAMS((Keymap));
extern Keymap rl_get_keymap PARAMS((void)); extern Keymap rl_get_keymap PARAMS((void));
/* Undocumented; used internally only. */ /* Undocumented; used internally only. */
extern void rl_set_keymap_from_edit_mode PARAMS((void)); extern void rl_set_keymap_from_edit_mode PARAMS((void));
extern char *rl_get_keymap_name_from_edit_mode PARAMS((void)); extern const char *rl_get_keymap_name_from_edit_mode PARAMS((void));
/* Functions for manipulating the funmap, which maps command names to functions. */ /* Functions for manipulating the funmap, which maps command names to functions. */
extern int rl_add_funmap_entry PARAMS((const char *, rl_command_func_t *)); extern int rl_add_funmap_entry PARAMS((const char *, rl_command_func_t *));
@ -406,7 +406,7 @@ extern void rl_set_screen_size PARAMS((int, int));
extern void rl_get_screen_size PARAMS((int *, int *)); extern void rl_get_screen_size PARAMS((int *, int *));
extern void rl_reset_screen_size PARAMS((void)); extern void rl_reset_screen_size PARAMS((void));
extern char *rl_get_termcap PARAMS((const char *)); extern const char *rl_get_termcap PARAMS((const char *));
/* Functions for character input. */ /* Functions for character input. */
extern int rl_stuff_char PARAMS((int)); extern int rl_stuff_char PARAMS((int));

View File

@ -77,7 +77,7 @@ typedef struct __rl_search_context
int sline_len; int sline_len;
int sline_index; int sline_index;
char *search_terminators; const char *search_terminators;
} _rl_search_cxt; } _rl_search_cxt;
/* Callback data for reading numeric arguments */ /* Callback data for reading numeric arguments */
@ -164,7 +164,7 @@ extern int rl_set_retained_kills PARAMS((int));
extern void _rl_set_screen_size PARAMS((int, int)); extern void _rl_set_screen_size PARAMS((int, int));
/* undo.c */ /* undo.c */
extern int _rl_fix_last_undo_of_type PARAMS((int, int, int)); extern int _rl_fix_last_undo_of_type PARAMS((enum undo_code, int, int));
/* util.c */ /* util.c */
extern char *_rl_savestring PARAMS((const char *)); extern char *_rl_savestring PARAMS((const char *));
@ -359,7 +359,7 @@ extern int _rl_vis_botlin;
extern int _rl_last_c_pos; extern int _rl_last_c_pos;
extern int _rl_suppress_redisplay; extern int _rl_suppress_redisplay;
extern int _rl_want_redisplay; extern int _rl_want_redisplay;
extern char *rl_display_prompt; extern const char *rl_display_prompt;
/* isearch.c */ /* isearch.c */
extern char *_rl_isearch_terminators; extern char *_rl_isearch_terminators;
@ -398,17 +398,17 @@ extern _rl_search_cxt *_rl_nscxt;
/* terminal.c */ /* terminal.c */
extern int _rl_enable_keypad; extern int _rl_enable_keypad;
extern int _rl_enable_meta; extern int _rl_enable_meta;
extern char *_rl_term_clreol; extern const char *_rl_term_clreol;
extern char *_rl_term_clrpag; extern const char *_rl_term_clrpag;
extern char *_rl_term_im; extern const char *_rl_term_im;
extern char *_rl_term_ic; extern const char *_rl_term_ic;
extern char *_rl_term_ei; extern const char *_rl_term_ei;
extern char *_rl_term_DC; extern const char *_rl_term_DC;
extern char *_rl_term_up; extern const char *_rl_term_up;
extern char *_rl_term_dc; extern const char *_rl_term_dc;
extern char *_rl_term_cr; extern const char *_rl_term_cr;
extern char *_rl_term_IC; extern const char *_rl_term_IC;
extern char *_rl_term_forward_char; extern const char *_rl_term_forward_char;
extern int _rl_screenheight; extern int _rl_screenheight;
extern int _rl_screenwidth; extern int _rl_screenwidth;
extern int _rl_screenchars; extern int _rl_screenchars;

View File

@ -764,7 +764,7 @@ rl_deprep_terminal ()
int int
rl_restart_output (count, key) rl_restart_output (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
#if defined (__MINGW32__) #if defined (__MINGW32__)
return 0; return 0;
@ -802,7 +802,7 @@ rl_restart_output (count, key)
int int
rl_stop_output (count, key) rl_stop_output (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
#if defined (__MINGW32__) #if defined (__MINGW32__)
return 0; return 0;

View File

@ -211,7 +211,7 @@ _rl_nsearch_init (dir, pchar)
rl_end = rl_point = 0; rl_end = rl_point = 0;
p = _rl_make_prompt_for_search (pchar ? pchar : ':'); p = _rl_make_prompt_for_search (pchar ? pchar : ':');
rl_message ("%s", p, 0); rl_message ("%s", p);
free (p); free (p);
RL_SETSTATE(RL_STATE_NSEARCH); RL_SETSTATE(RL_STATE_NSEARCH);
@ -383,7 +383,7 @@ noninc_search (dir, pchar)
code calls this, KEY will be `?'. */ code calls this, KEY will be `?'. */
int int
rl_noninc_forward_search (count, key) rl_noninc_forward_search (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
return noninc_search (1, (key == '?') ? '?' : 0); return noninc_search (1, (key == '?') ? '?' : 0);
} }
@ -392,7 +392,7 @@ rl_noninc_forward_search (count, key)
calls this, KEY will be `/'. */ calls this, KEY will be `/'. */
int int
rl_noninc_reverse_search (count, key) rl_noninc_reverse_search (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
return noninc_search (-1, (key == '/') ? '/' : 0); return noninc_search (-1, (key == '/') ? '/' : 0);
} }
@ -401,7 +401,7 @@ rl_noninc_reverse_search (count, key)
for. If there is no saved search string, abort. */ for. If there is no saved search string, abort. */
int int
rl_noninc_forward_search_again (count, key) rl_noninc_forward_search_again (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
int r; int r;
@ -418,7 +418,7 @@ rl_noninc_forward_search_again (count, key)
for. If there is no saved search string, abort. */ for. If there is no saved search string, abort. */
int int
rl_noninc_reverse_search_again (count, key) rl_noninc_reverse_search_again (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
int r; int r;

View File

@ -104,34 +104,36 @@ char PC, *BC, *UP;
#endif /* __linux__ */ #endif /* __linux__ */
/* Some strings to control terminal actions. These are output by tputs (). */ /* Some strings to control terminal actions. These are output by tputs (). */
char *_rl_term_clreol; const char *_rl_term_clreol;
char *_rl_term_clrpag; const char *_rl_term_clrpag;
char *_rl_term_cr; const char *_rl_term_cr;
char *_rl_term_backspace; const char *_rl_term_backspace;
char *_rl_term_goto; char _rl_term_backspace_default[2] = { '\b', 0 };
char *_rl_term_pc; const char *_rl_term_goto;
const char *_rl_term_pc;
/* Non-zero if we determine that the terminal can do character insertion. */ /* Non-zero if we determine that the terminal can do character insertion. */
int _rl_terminal_can_insert = 0; int _rl_terminal_can_insert = 0;
/* How to insert characters. */ /* How to insert characters. */
char *_rl_term_im; const char *_rl_term_im;
char *_rl_term_ei; const char *_rl_term_ei;
char *_rl_term_ic; const char *_rl_term_ic;
char *_rl_term_ip; const char *_rl_term_ip;
char *_rl_term_IC; const char *_rl_term_IC;
/* How to delete characters. */ /* How to delete characters. */
char *_rl_term_dc; const char *_rl_term_dc;
char *_rl_term_DC; const char *_rl_term_DC;
char *_rl_term_forward_char; const char *_rl_term_forward_char;
/* How to go up a line. */ /* How to go up a line. */
char *_rl_term_up; const char *_rl_term_up;
char _rl_term_up_default[2] = { 0, 0 };
/* A visible bell; char if the terminal can be made to flash the screen. */ /* A visible bell; char if the terminal can be made to flash the screen. */
static char *_rl_visible_bell; static const char *_rl_visible_bell;
/* Non-zero means the terminal can auto-wrap lines. */ /* Non-zero means the terminal can auto-wrap lines. */
int _rl_term_autowrap = -1; int _rl_term_autowrap = -1;
@ -141,33 +143,33 @@ static int term_has_meta;
/* The sequences to write to turn on and off the meta key, if this /* The sequences to write to turn on and off the meta key, if this
terminal has one. */ terminal has one. */
static char *_rl_term_mm; static const char *_rl_term_mm;
static char *_rl_term_mo; static const char *_rl_term_mo;
/* The key sequences output by the arrow keys, if this terminal has any. */ /* The key sequences output by the arrow keys, if this terminal has any. */
static char *_rl_term_ku; static const char *_rl_term_ku;
static char *_rl_term_kd; static const char *_rl_term_kd;
static char *_rl_term_kr; static const char *_rl_term_kr;
static char *_rl_term_kl; static const char *_rl_term_kl;
/* How to initialize and reset the arrow keys, if this terminal has any. */ /* How to initialize and reset the arrow keys, if this terminal has any. */
static char *_rl_term_ks; static const char *_rl_term_ks;
static char *_rl_term_ke; static const char *_rl_term_ke;
/* The key sequences sent by the Home and End keys, if any. */ /* The key sequences sent by the Home and End keys, if any. */
static char *_rl_term_kh; static const char *_rl_term_kh;
static char *_rl_term_kH; static const char *_rl_term_kH;
static char *_rl_term_at7; /* @7 */ static const char *_rl_term_at7; /* @7 */
/* Delete key */ /* Delete key */
static char *_rl_term_kD; static const char *_rl_term_kD;
/* Insert key */ /* Insert key */
static char *_rl_term_kI; static const char *_rl_term_kI;
/* Cursor control */ /* Cursor control */
static char *_rl_term_vs; /* very visible */ static const char *_rl_term_vs; /* very visible */
static char *_rl_term_ve; /* normal */ static const char *_rl_term_ve; /* normal */
static void bind_termcap_arrow_keys PARAMS((Keymap)); static void bind_termcap_arrow_keys PARAMS((Keymap));
@ -362,7 +364,7 @@ rl_resize_terminal ()
struct _tc_string { struct _tc_string {
const char *tc_var; const char *tc_var;
char **tc_value; const char **tc_value;
}; };
/* This should be kept sorted, just in case we decide to change the /* This should be kept sorted, just in case we decide to change the
@ -409,7 +411,7 @@ get_term_capabilities (bp)
char **bp; char **bp;
{ {
#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */ #if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
register int i; register unsigned int i;
for (i = 0; i < NUM_TC_STRINGS; i++) for (i = 0; i < NUM_TC_STRINGS; i++)
*(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp); *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
@ -496,8 +498,9 @@ _rl_init_terminal_io (terminal_name)
tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we
change that later... */ change that later... */
PC = '\0'; PC = '\0';
BC = _rl_term_backspace = "\b"; _rl_term_backspace = _rl_term_backspace_default;
UP = _rl_term_up; BC = (char*)_rl_term_backspace;
UP = (char*)_rl_term_up;
return 0; return 0;
} }
@ -507,8 +510,8 @@ _rl_init_terminal_io (terminal_name)
/* Set up the variables that the termcap library expects the application /* Set up the variables that the termcap library expects the application
to provide. */ to provide. */
PC = _rl_term_pc ? *_rl_term_pc : 0; PC = _rl_term_pc ? *_rl_term_pc : 0;
BC = _rl_term_backspace; BC = (char*)_rl_term_backspace;
UP = _rl_term_up; UP = (char*)_rl_term_up;
if (!_rl_term_cr) if (!_rl_term_cr)
_rl_term_cr = "\r"; _rl_term_cr = "\r";
@ -568,11 +571,11 @@ bind_termcap_arrow_keys (map)
_rl_keymap = xkeymap; _rl_keymap = xkeymap;
} }
char * const char *
rl_get_termcap (cap) rl_get_termcap (cap)
const char *cap; const char *cap;
{ {
register int i; register unsigned int i;
if (tcap_initialized == 0) if (tcap_initialized == 0)
return ((char *)NULL); return ((char *)NULL);

View File

@ -410,7 +410,7 @@ rl_backward (count, key)
/* Move to the beginning of the line. */ /* Move to the beginning of the line. */
int int
rl_beg_of_line (count, key) rl_beg_of_line (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
rl_point = 0; rl_point = 0;
return 0; return 0;
@ -419,7 +419,7 @@ rl_beg_of_line (count, key)
/* Move to the end of the line. */ /* Move to the end of the line. */
int int
rl_end_of_line (count, key) rl_end_of_line (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
rl_point = rl_end; rl_point = rl_end;
return 0; return 0;
@ -527,7 +527,7 @@ rl_backward_word (count, key)
/* Clear the current line. Numeric argument to C-l does this. */ /* Clear the current line. Numeric argument to C-l does this. */
int int
rl_refresh_line (ignore1, ignore2) rl_refresh_line (ignore1, ignore2)
int ignore1, ignore2; int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
{ {
int curr_line; int curr_line;
@ -566,7 +566,7 @@ rl_clear_screen (count, key)
int int
rl_arrow_keys (count, c) rl_arrow_keys (count, c)
int count, c; int count, c __attribute__((unused));
{ {
int ch; int ch;
@ -884,7 +884,7 @@ _rl_insert_next_callback (data)
int int
rl_quoted_insert (count, key) rl_quoted_insert (count, key)
int count, key; int count, key __attribute__((unused));
{ {
/* Let's see...should the callback interface futz with signal handling? */ /* Let's see...should the callback interface futz with signal handling? */
#if defined (HANDLE_SIGNALS) #if defined (HANDLE_SIGNALS)
@ -907,7 +907,7 @@ rl_quoted_insert (count, key)
/* Insert a tab character. */ /* Insert a tab character. */
int int
rl_tab_insert (count, key) rl_tab_insert (count, key)
int count, key; int count, key __attribute__((unused));
{ {
return (_rl_insert_char (count, '\t')); return (_rl_insert_char (count, '\t'));
} }
@ -917,7 +917,7 @@ rl_tab_insert (count, key)
meaning in the future. */ meaning in the future. */
int int
rl_newline (count, key) rl_newline (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
rl_done = 1; rl_done = 1;
@ -951,7 +951,7 @@ rl_newline (count, key)
is special cased. */ is special cased. */
int int
rl_do_lowercase_version (ignore1, ignore2) rl_do_lowercase_version (ignore1, ignore2)
int ignore1, ignore2; int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
{ {
return 0; return 0;
} }
@ -1118,7 +1118,7 @@ rl_rubout_or_delete (count, key)
/* Delete all spaces and tabs around point. */ /* Delete all spaces and tabs around point. */
int int
rl_delete_horizontal_space (count, ignore) rl_delete_horizontal_space (count, ignore)
int count, ignore; int count __attribute__((unused)), ignore __attribute__((unused));
{ {
int start = rl_point; int start = rl_point;
@ -1163,9 +1163,9 @@ rl_delete_or_show_completions (count, key)
A K*rn shell style function. */ A K*rn shell style function. */
int int
rl_insert_comment (count, key) rl_insert_comment (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
char *rl_comment_text; const char *rl_comment_text;
int rl_comment_len; int rl_comment_len;
rl_beg_of_line (1, key); rl_beg_of_line (1, key);
@ -1202,7 +1202,7 @@ rl_insert_comment (count, key)
/* Uppercase the word at point. */ /* Uppercase the word at point. */
int int
rl_upcase_word (count, key) rl_upcase_word (count, key)
int count, key; int count, key __attribute__((unused));
{ {
return (rl_change_case (count, UpCase)); return (rl_change_case (count, UpCase));
} }
@ -1210,7 +1210,7 @@ rl_upcase_word (count, key)
/* Lowercase the word at point. */ /* Lowercase the word at point. */
int int
rl_downcase_word (count, key) rl_downcase_word (count, key)
int count, key; int count, key __attribute__((unused));
{ {
return (rl_change_case (count, DownCase)); return (rl_change_case (count, DownCase));
} }
@ -1218,7 +1218,7 @@ rl_downcase_word (count, key)
/* Upcase the first letter, downcase the rest. */ /* Upcase the first letter, downcase the rest. */
int int
rl_capitalize_word (count, key) rl_capitalize_word (count, key)
int count, key; int count, key __attribute__((unused));
{ {
return (rl_change_case (count, CapCase)); return (rl_change_case (count, CapCase));
} }
@ -1381,7 +1381,7 @@ rl_transpose_words (count, key)
then transpose the characters before point. */ then transpose the characters before point. */
int int
rl_transpose_chars (count, key) rl_transpose_chars (count, key)
int count, key; int count, key __attribute__((unused));
{ {
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
char *dummy; char *dummy;
@ -1557,7 +1557,7 @@ _rl_char_search_callback (data)
int int
rl_char_search (count, key) rl_char_search (count, key)
int count, key; int count, key __attribute__((unused));
{ {
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
if (RL_ISSTATE (RL_STATE_CALLBACK)) if (RL_ISSTATE (RL_STATE_CALLBACK))
@ -1575,7 +1575,7 @@ rl_char_search (count, key)
int int
rl_backward_char_search (count, key) rl_backward_char_search (count, key)
int count, key; int count, key __attribute__((unused));
{ {
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
if (RL_ISSTATE (RL_STATE_CALLBACK)) if (RL_ISSTATE (RL_STATE_CALLBACK))
@ -1612,7 +1612,7 @@ _rl_set_mark_at_pos (position)
/* A bindable command to set the mark. */ /* A bindable command to set the mark. */
int int
rl_set_mark (count, key) rl_set_mark (count, key)
int count, key; int count, key __attribute__((unused));
{ {
return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point)); return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point));
} }
@ -1620,7 +1620,7 @@ rl_set_mark (count, key)
/* Exchange the position of mark and point. */ /* Exchange the position of mark and point. */
int int
rl_exchange_point_and_mark (count, key) rl_exchange_point_and_mark (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
if (rl_mark > rl_end) if (rl_mark > rl_end)
rl_mark = -1; rl_mark = -1;

View File

@ -196,7 +196,7 @@ tilde_expand (string)
int result_size, result_index; int result_size, result_index;
result_index = result_size = 0; result_index = result_size = 0;
if (result = strchr (string, '~')) if ((result = strchr (string, '~')))
result = (char *)xmalloc (result_size = (strlen (string) + 16)); result = (char *)xmalloc (result_size = (strlen (string) + 16));
else else
result = (char *)xmalloc (result_size = (strlen (string) + 1)); result = (char *)xmalloc (result_size = (strlen (string) + 1));

View File

@ -231,7 +231,8 @@ rl_do_undo ()
int int
_rl_fix_last_undo_of_type (type, start, end) _rl_fix_last_undo_of_type (type, start, end)
int type, start, end; enum undo_code type;
int start, end;
{ {
UNDO_LIST *rl; UNDO_LIST *rl;
@ -289,7 +290,7 @@ rl_modifying (start, end)
/* Revert the current line to its previous state. */ /* Revert the current line to its previous state. */
int int
rl_revert_line (count, key) rl_revert_line (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
if (!rl_undo_list) if (!rl_undo_list)
rl_ding (); rl_ding ();
@ -309,7 +310,7 @@ rl_revert_line (count, key)
/* Do some undoing of things that were done. */ /* Do some undoing of things that were done. */
int int
rl_undo_command (count, key) rl_undo_command (count, key)
int count, key; int count, key __attribute__((unused));
{ {
if (count < 0) if (count < 0)
return 0; /* Nothing to do. */ return 0; /* Nothing to do. */

View File

@ -115,14 +115,14 @@ _rl_abort_internal ()
int int
rl_abort (count, key) rl_abort (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
return (_rl_abort_internal ()); return (_rl_abort_internal ());
} }
int int
rl_tty_status (count, key) rl_tty_status (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
#if defined (TIOCSTAT) #if defined (TIOCSTAT)
ioctl (1, TIOCSTAT, (char *)0); ioctl (1, TIOCSTAT, (char *)0);
@ -172,7 +172,7 @@ rl_extend_line_buffer (len)
/* A function for simple tilde expansion. */ /* A function for simple tilde expansion. */
int int
rl_tilde_expand (ignore, key) rl_tilde_expand (ignore, key)
int ignore, key; int ignore __attribute__((unused)), key __attribute__((unused));
{ {
register int start, end; register int start, end;
char *homedir, *temp; char *homedir, *temp;

View File

@ -131,7 +131,7 @@ static int _rl_vi_callback_char_search PARAMS((_rl_callback_generic_arg *));
void void
_rl_vi_initialize_line () _rl_vi_initialize_line ()
{ {
register int i; register size_t i;
for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++) for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++)
vi_mark_chars[i] = -1; vi_mark_chars[i] = -1;
@ -190,7 +190,7 @@ _rl_vi_stuff_insert (count)
puts you back into insert mode. */ puts you back into insert mode. */
int int
rl_vi_redo (count, c) rl_vi_redo (count, c)
int count, c; int count, c __attribute__((unused));
{ {
int r; int r;
@ -238,7 +238,7 @@ rl_vi_undo (count, key)
/* Yank the nth arg from the previous line into this line at point. */ /* Yank the nth arg from the previous line into this line at point. */
int int
rl_vi_yank_arg (count, key) rl_vi_yank_arg (count, key)
int count, key; int count, key __attribute__((unused));
{ {
/* Readline thinks that the first word on a line is the 0th, while vi /* Readline thinks that the first word on a line is the 0th, while vi
thinks the first word on a line is the 1st. Compensate. */ thinks the first word on a line is the 1st. Compensate. */
@ -321,7 +321,7 @@ rl_vi_search (count, key)
/* Completion, from vi's point of view. */ /* Completion, from vi's point of view. */
int int
rl_vi_complete (ignore, key) rl_vi_complete (ignore, key)
int ignore, key; int ignore __attribute__((unused)), key;
{ {
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
{ {
@ -348,7 +348,7 @@ rl_vi_complete (ignore, key)
/* Tilde expansion for vi mode. */ /* Tilde expansion for vi mode. */
int int
rl_vi_tilde_expand (ignore, key) rl_vi_tilde_expand (ignore, key)
int ignore, key; int ignore __attribute__((unused)), key;
{ {
rl_tilde_expand (0, key); rl_tilde_expand (0, key);
rl_vi_start_inserting (key, 1, rl_arg_sign); rl_vi_start_inserting (key, 1, rl_arg_sign);
@ -419,7 +419,7 @@ rl_vi_end_word (count, key)
/* Move forward a word the way that 'W' does. */ /* Move forward a word the way that 'W' does. */
int int
rl_vi_fWord (count, ignore) rl_vi_fWord (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
while (count-- && rl_point < (rl_end - 1)) while (count-- && rl_point < (rl_end - 1))
{ {
@ -436,7 +436,7 @@ rl_vi_fWord (count, ignore)
int int
rl_vi_bWord (count, ignore) rl_vi_bWord (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
while (count-- && rl_point > 0) while (count-- && rl_point > 0)
{ {
@ -460,7 +460,7 @@ rl_vi_bWord (count, ignore)
int int
rl_vi_eWord (count, ignore) rl_vi_eWord (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
while (count-- && rl_point < (rl_end - 1)) while (count-- && rl_point < (rl_end - 1))
{ {
@ -491,7 +491,7 @@ rl_vi_eWord (count, ignore)
int int
rl_vi_fword (count, ignore) rl_vi_fword (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
while (count-- && rl_point < (rl_end - 1)) while (count-- && rl_point < (rl_end - 1))
{ {
@ -517,7 +517,7 @@ rl_vi_fword (count, ignore)
int int
rl_vi_bword (count, ignore) rl_vi_bword (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
while (count-- && rl_point > 0) while (count-- && rl_point > 0)
{ {
@ -556,7 +556,7 @@ rl_vi_bword (count, ignore)
int int
rl_vi_eword (count, ignore) rl_vi_eword (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
while (count-- && rl_point < rl_end - 1) while (count-- && rl_point < rl_end - 1)
{ {
@ -581,7 +581,7 @@ rl_vi_eword (count, ignore)
int int
rl_vi_insert_beg (count, key) rl_vi_insert_beg (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
rl_beg_of_line (1, key); rl_beg_of_line (1, key);
rl_vi_insertion_mode (1, key); rl_vi_insertion_mode (1, key);
@ -610,7 +610,7 @@ _rl_vi_append_forward (key)
int int
rl_vi_append_mode (count, key) rl_vi_append_mode (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
_rl_vi_append_forward (key); _rl_vi_append_forward (key);
rl_vi_start_inserting (key, 1, rl_arg_sign); rl_vi_start_inserting (key, 1, rl_arg_sign);
@ -619,7 +619,7 @@ rl_vi_append_mode (count, key)
int int
rl_vi_append_eol (count, key) rl_vi_append_eol (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
rl_end_of_line (1, key); rl_end_of_line (1, key);
rl_vi_append_mode (1, key); rl_vi_append_mode (1, key);
@ -629,7 +629,7 @@ rl_vi_append_eol (count, key)
/* What to do in the case of C-d. */ /* What to do in the case of C-d. */
int int
rl_vi_eof_maybe (count, c) rl_vi_eof_maybe (count, c)
int count, c; int count __attribute__((unused)), c __attribute__((unused));
{ {
return (rl_newline (1, '\n')); return (rl_newline (1, '\n'));
} }
@ -640,7 +640,7 @@ rl_vi_eof_maybe (count, c)
switching keymaps. */ switching keymaps. */
int int
rl_vi_insertion_mode (count, key) rl_vi_insertion_mode (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
_rl_keymap = vi_insertion_keymap; _rl_keymap = vi_insertion_keymap;
_rl_vi_last_key_before_insert = key; _rl_vi_last_key_before_insert = key;
@ -703,7 +703,7 @@ _rl_vi_done_inserting ()
int int
rl_vi_movement_mode (count, key) rl_vi_movement_mode (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
if (rl_point > 0) if (rl_point > 0)
rl_backward_char (1, key); rl_backward_char (1, key);
@ -783,7 +783,7 @@ _rl_vi_change_mbchar_case (count)
int int
rl_vi_change_case (count, ignore) rl_vi_change_case (count, ignore)
int count, ignore; int count, ignore __attribute__((unused));
{ {
int c, p; int c, p;
@ -1031,7 +1031,7 @@ rl_digit_loop1 ()
int int
rl_vi_delete_to (count, key) rl_vi_delete_to (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
int c; int c;
@ -1057,7 +1057,7 @@ rl_vi_delete_to (count, key)
int int
rl_vi_change_to (count, key) rl_vi_change_to (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
int c, start_pos; int c, start_pos;
@ -1110,7 +1110,7 @@ rl_vi_change_to (count, key)
int int
rl_vi_yank_to (count, key) rl_vi_yank_to (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
int c, save; int c, save;
@ -1202,7 +1202,7 @@ rl_vi_delete (count, key)
int int
rl_vi_back_to_indent (count, key) rl_vi_back_to_indent (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
rl_beg_of_line (1, key); rl_beg_of_line (1, key);
while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point]))
@ -1212,7 +1212,7 @@ rl_vi_back_to_indent (count, key)
int int
rl_vi_first_print (count, key) rl_vi_first_print (count, key)
int count, key; int count __attribute__((unused)), key;
{ {
return (rl_vi_back_to_indent (1, key)); return (rl_vi_back_to_indent (1, key));
} }
@ -1319,7 +1319,7 @@ rl_vi_char_search (count, key)
/* Match brackets */ /* Match brackets */
int int
rl_vi_match (ignore, key) rl_vi_match (ignore, key)
int ignore, key; int ignore __attribute__((unused)), key;
{ {
int count = 1, brack, pos, tmp, pre; int count = 1, brack, pos, tmp, pre;
@ -1426,7 +1426,7 @@ rl_vi_bracktype (c)
static int static int
_rl_vi_change_char (count, c, mb) _rl_vi_change_char (count, c, mb)
int count, c; int count, c;
char *mb; char *mb __attribute__((unused));
{ {
int p; int p;
@ -1458,8 +1458,8 @@ _rl_vi_change_char (count, c, mb)
static int static int
_rl_vi_callback_getchar (mb, mlen) _rl_vi_callback_getchar (mb, mlen)
char *mb; char *mb __attribute__((unused));
int mlen; int mlen __attribute__((unused));
{ {
int c; int c;
@ -1494,7 +1494,7 @@ _rl_vi_callback_change_char (data)
int int
rl_vi_change_char (count, key) rl_vi_change_char (count, key)
int count, key; int count, key __attribute__((unused));
{ {
int c; int c;
char mb[MB_LEN_MAX]; char mb[MB_LEN_MAX];
@ -1582,7 +1582,7 @@ rl_vi_overstrike_delete (count, key)
int int
rl_vi_replace (count, key) rl_vi_replace (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
int i; int i;
@ -1663,7 +1663,7 @@ _rl_vi_set_mark ()
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
static int static int
_rl_vi_callback_set_mark (data) _rl_vi_callback_set_mark (data)
_rl_callback_generic_arg *data; _rl_callback_generic_arg *data __attribute__((unused));
{ {
_rl_callback_func = 0; _rl_callback_func = 0;
_rl_want_redisplay = 1; _rl_want_redisplay = 1;
@ -1674,7 +1674,7 @@ _rl_vi_callback_set_mark (data)
int int
rl_vi_set_mark (count, key) rl_vi_set_mark (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
if (RL_ISSTATE (RL_STATE_CALLBACK)) if (RL_ISSTATE (RL_STATE_CALLBACK))
@ -1721,7 +1721,7 @@ _rl_vi_goto_mark ()
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
static int static int
_rl_vi_callback_goto_mark (data) _rl_vi_callback_goto_mark (data)
_rl_callback_generic_arg *data; _rl_callback_generic_arg *data __attribute__((unused));
{ {
_rl_callback_func = 0; _rl_callback_func = 0;
_rl_want_redisplay = 1; _rl_want_redisplay = 1;
@ -1732,7 +1732,7 @@ _rl_vi_callback_goto_mark (data)
int int
rl_vi_goto_mark (count, key) rl_vi_goto_mark (count, key)
int count, key; int count __attribute__((unused)), key __attribute__((unused));
{ {
#if defined (READLINE_CALLBACKS) #if defined (READLINE_CALLBACKS)
if (RL_ISSTATE (RL_STATE_CALLBACK)) if (RL_ISSTATE (RL_STATE_CALLBACK))

View File

@ -790,6 +790,7 @@ void processReply(SSL& ssl)
if (ssl.GetError()) return; if (ssl.GetError()) return;
if (DoProcessReply(ssl)) if (DoProcessReply(ssl))
{
// didn't complete process // didn't complete process
if (!ssl.getSocket().IsNonBlocking()) { if (!ssl.getSocket().IsNonBlocking()) {
// keep trying now, blocking ok // keep trying now, blocking ok
@ -799,6 +800,7 @@ void processReply(SSL& ssl)
else else
// user will have try again later, non blocking // user will have try again later, non blocking
ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); ssl.SetError(YasslError(SSL_ERROR_WANT_READ));
}
} }
@ -873,10 +875,12 @@ void sendServerKeyExchange(SSL& ssl, BufferOutput buffer)
void sendChangeCipher(SSL& ssl, BufferOutput buffer) void sendChangeCipher(SSL& ssl, BufferOutput buffer)
{ {
if (ssl.getSecurity().get_parms().entity_ == server_end) if (ssl.getSecurity().get_parms().entity_ == server_end)
{
if (ssl.getSecurity().get_resuming()) if (ssl.getSecurity().get_resuming())
ssl.verifyState(clientKeyExchangeComplete); ssl.verifyState(clientKeyExchangeComplete);
else else
ssl.verifyState(clientFinishedComplete); ssl.verifyState(clientFinishedComplete);
}
if (ssl.GetError()) return; if (ssl.GetError()) return;
ChangeCipherSpec ccs; ChangeCipherSpec ccs;

View File

@ -1305,6 +1305,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl)
ssl.useSecurity().use_connection().sessionID_Set_ = false; ssl.useSecurity().use_connection().sessionID_Set_ = false;
if (ssl.getSecurity().get_resuming()) if (ssl.getSecurity().get_resuming())
{
if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(), if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(),
ID_LEN) == 0) { ID_LEN) == 0) {
ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret()); ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret());
@ -1319,6 +1320,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl)
ssl.useSecurity().set_resuming(false); ssl.useSecurity().set_resuming(false);
ssl.useLog().Trace("server denied resumption"); ssl.useLog().Trace("server denied resumption");
} }
}
if (ssl.CompressionOn() && !compression_method_) if (ssl.CompressionOn() && !compression_method_)
ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request

View File

@ -96,10 +96,12 @@ inline void Mode_BASE::Process(byte* out, const byte* in, word32 sz)
if (mode_ == ECB) if (mode_ == ECB)
ECB_Process(out, in, sz); ECB_Process(out, in, sz);
else if (mode_ == CBC) else if (mode_ == CBC)
{
if (dir_ == ENCRYPTION) if (dir_ == ENCRYPTION)
CBC_Encrypt(out, in, sz); CBC_Encrypt(out, in, sz);
else else
CBC_Decrypt(out, in, sz); CBC_Decrypt(out, in, sz);
}
} }

View File

@ -781,10 +781,12 @@ void CertDecoder::GetDate(DateType dt)
source_.advance(length); source_.advance(length);
if (!ValidateDate(date, b, dt) && verify_) if (!ValidateDate(date, b, dt) && verify_)
{
if (dt == BEFORE) if (dt == BEFORE)
source_.SetError(BEFORE_DATE_E); source_.SetError(BEFORE_DATE_E);
else else
source_.SetError(AFTER_DATE_E); source_.SetError(AFTER_DATE_E);
}
// save for later use // save for later use
if (dt == BEFORE) { if (dt == BEFORE) {
@ -1062,6 +1064,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
} }
word32 rLen = GetLength(source); word32 rLen = GetLength(source);
if (rLen != 20) if (rLen != 20)
{
if (rLen == 21) { // zero at front, eat if (rLen == 21) { // zero at front, eat
source.next(); source.next();
--rLen; --rLen;
@ -1074,6 +1077,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
source.SetError(DSA_SZ_E); source.SetError(DSA_SZ_E);
return 0; return 0;
} }
}
memcpy(decoded, source.get_buffer() + source.get_index(), rLen); memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
source.advance(rLen); source.advance(rLen);
@ -1084,6 +1088,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
} }
word32 sLen = GetLength(source); word32 sLen = GetLength(source);
if (sLen != 20) if (sLen != 20)
{
if (sLen == 21) { if (sLen == 21) {
source.next(); // zero at front, eat source.next(); // zero at front, eat
--sLen; --sLen;
@ -1096,6 +1101,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
source.SetError(DSA_SZ_E); source.SetError(DSA_SZ_E);
return 0; return 0;
} }
}
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen); memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
source.advance(sLen); source.advance(sLen);

View File

@ -4352,7 +4352,7 @@ void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
{ {
if (i) if (i)
my_b_printf(&cache, ","); my_b_printf(&cache, ",");
my_b_printf(&cache, field); my_b_printf(&cache, "%s", field);
field += field_lens[i] + 1; field += field_lens[i] + 1;
} }
@ -6680,7 +6680,7 @@ void Execute_load_query_log_event::print(FILE* file,
{ {
my_b_write(&cache, (uchar*) query, fn_pos_start); my_b_write(&cache, (uchar*) query, fn_pos_start);
my_b_printf(&cache, " LOCAL INFILE \'"); my_b_printf(&cache, " LOCAL INFILE \'");
my_b_printf(&cache, local_fname); my_b_printf(&cache, "%s", local_fname);
my_b_printf(&cache, "\'"); my_b_printf(&cache, "\'");
if (dup_handling == LOAD_DUP_REPLACE) if (dup_handling == LOAD_DUP_REPLACE)
my_b_printf(&cache, " REPLACE"); my_b_printf(&cache, " REPLACE");

View File

@ -147,7 +147,7 @@ static int send_file(THD *thd)
if (errmsg) if (errmsg)
{ {
sql_print_error("Failed in send_file() %s", errmsg); sql_print_error("Failed in send_file() %s", errmsg);
DBUG_PRINT("error", (errmsg)); DBUG_PRINT("error", ("%s", errmsg));
} }
DBUG_RETURN(error); DBUG_RETURN(error);
} }

View File

@ -4780,7 +4780,7 @@ send_result_message:
const char *err_msg= thd->main_da.message(); const char *err_msg= thd->main_da.message();
if (!thd->vio_ok()) if (!thd->vio_ok())
{ {
sql_print_error(err_msg); sql_print_error("%s", err_msg);
} }
else else
{ {

View File

@ -21,7 +21,7 @@
extern "C" { extern "C" {
void sql_alloc_error_handler(void) void sql_alloc_error_handler(void)
{ {
sql_print_error(ER(ER_OUT_OF_RESOURCES)); sql_print_error("%s", ER(ER_OUT_OF_RESOURCES));
THD *thd= current_thd; THD *thd= current_thd;
if (thd) if (thd)

View File

@ -95,7 +95,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
if (!thd->vio_ok()) if (!thd->vio_ok())
{ {
sql_print_error(msgbuf); sql_print_error("%s", msgbuf);
return; return;
} }

View File

@ -306,7 +306,7 @@ int decimal_actual_fraction(decimal_t *from)
{ {
for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1); for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1);
*buf0 % powers10[i++] == 0; *buf0 % powers10[i++] == 0;
frac--); frac--) ;
} }
return frac; return frac;
} }
@ -500,7 +500,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1); stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1);
i= 1; i= 1;
} }
for (; *buf_end % powers10[i++] == 0; stop--); for (; *buf_end % powers10[i++] == 0; stop--) ;
*end_result= stop; /* index of position after last decimal digit (from 0) */ *end_result= stop; /* index of position after last decimal digit (from 0) */
} }
@ -1011,7 +1011,7 @@ static int ull2dec(ulonglong from, decimal_t *to)
sanity(to); sanity(to);
for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE); for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) ;
if (unlikely(intg1 > to->len)) if (unlikely(intg1 > to->len))
{ {
intg1=to->len; intg1=to->len;