diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 65e52b1f..f46ea062 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -1709,3 +1709,41 @@ lib/sh/unicode.c siglist.c - include command.h before general.h for PARAMS and prototypes. Report from Osipov, Michael (LDA IT PLM) + + 8/18 + ---- +lib/readline/colors.c + - S_ISBLK: make sure it's defined before we use it, like in complete.c + +lib/readline/complete.c,{bashline,variables}.c + - minor changes to prep for making rl_completer_word_break_characters + `const' + +subst.[ch],pcomplete.c + - split_at_delims: the DELIMS argument is now `const'; change callers + +lib/readline/rlmbutil.h + - _rl_wcwidth: add function prototype for inline function declaration + +lib/readline/bind.c + - _rl_get_keyname: print keys greater than 160 (which are valid UTF-8) + as octal escape sequences + +lib/readline/text.c + - do_lowercase_version: return 99999 to prevent the linker from + combining it with _rl_null_function and optimizing away the separate + copy. That messes with function pointer comparisons. Part of this + batch of fixes from sparrowhawk996@gmail.com + + 8/19 + ---- +complete.c,readline.c,readline.h + - rl_completer_word_break_characters: now const char * like + rl_basic_word_break_characters; element of eadline state struct + used to save it also const. THIS IS AN API CHANGE + +bashline.c + - orig_rl_completer_word_break_characters: now const char * like + rl_completer_word_break_characters + + diff --git a/bashline.c b/bashline.c index aa9d01c2..249033d4 100644 --- a/bashline.c +++ b/bashline.c @@ -374,7 +374,8 @@ enable_hostname_completion (on_or_off) int on_or_off; { int old_value; - char *at, *nv, *nval; + char *nv, *nval; + const char *at; old_value = perform_hostname_completion; @@ -434,7 +435,7 @@ enable_hostname_completion (on_or_off) strcpy (nval + 1, rl_completer_word_break_characters); } - free (rl_completer_word_break_characters); + free ((void *)rl_completer_word_break_characters); rl_completer_word_break_characters = nval; } @@ -3814,7 +3815,7 @@ bash_complete_filename_internal (what_to_do) rl_completion_func_t *orig_attempt_func; rl_icppfunc_t *orig_dir_func; rl_compignore_func_t *orig_ignore_func; - /*const*/ char *orig_rl_completer_word_break_characters; + const char *orig_rl_completer_word_break_characters; int r; orig_func = rl_completion_entry_function; diff --git a/lib/readline/bind.c b/lib/readline/bind.c index 4f4539d6..b8a5deb9 100644 --- a/lib/readline/bind.c +++ b/lib/readline/bind.c @@ -2634,6 +2634,15 @@ _rl_get_keyname (int key) keyname[i++] = (c / 8) + '0'; c = (c % 8) + '0'; } + /* These characters are valid UTF-8; convert them into octal escape + sequences as well. This changes C. */ + else if (c >= 160) + { + keyname[i++] = '\\'; + keyname[i++] = '0' + ((((unsigned char)c) >> 6) & 0x07); + keyname[i++] = '0' + ((((unsigned char)c) >> 3) & 0x07); + c = (c % 8) + '0'; + } /* Now, if the character needs to be quoted with a backslash, do that. */ if (c == '\\' || c == '"') diff --git a/lib/readline/colors.c b/lib/readline/colors.c index 9e37527e..d615d70d 100644 --- a/lib/readline/colors.c +++ b/lib/readline/colors.c @@ -2,7 +2,7 @@ Modified by Chet Ramey for Readline. - Copyright (C) 1985, 1988, 1990-1991, 1995-2010, 2012, 2015, 2017, 2019 + Copyright (C) 1985, 1988, 1990-1991, 1995-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -239,8 +239,10 @@ _rl_print_color_indicator (const char *f) else if (S_ISSOCK (mode)) colored_filetype = C_SOCK; #endif +#if defined (S_ISBLK) else if (S_ISBLK (mode)) colored_filetype = C_BLK; +#endif else if (S_ISCHR (mode)) colored_filetype = C_CHR; else diff --git a/lib/readline/complete.c b/lib/readline/complete.c index e185bb48..3f80c1cf 100644 --- a/lib/readline/complete.c +++ b/lib/readline/complete.c @@ -304,7 +304,7 @@ const char *rl_basic_quote_characters = "\"'"; /* The list of characters that signal a break between words for rl_complete_internal. The default list is the contents of rl_basic_word_break_characters. */ -/*const*/ char *rl_completer_word_break_characters = (/*const*/ char *)NULL; +const char *rl_completer_word_break_characters = 0; /* Hook function to allow an application to set the completion word break characters before readline breaks up the line. Allows @@ -1078,7 +1078,8 @@ char _rl_find_completion_word (int *fp, int *dp) { int scan, end, found_quote, delimiter, pass_next, isbrk; - char quote_char, *brkchars; + char quote_char; + const char *brkchars; end = rl_point; found_quote = delimiter = 0; diff --git a/lib/readline/readline.c b/lib/readline/readline.c index a048d58b..371e1fbc 100644 --- a/lib/readline/readline.c +++ b/lib/readline/readline.c @@ -1299,8 +1299,8 @@ readline_initialize_everything (void) /* If the completion parser's default word break characters haven't been set yet, then do so now. */ - if (rl_completer_word_break_characters == (char *)NULL) - rl_completer_word_break_characters = (char *)rl_basic_word_break_characters; + if (rl_completer_word_break_characters == 0) + rl_completer_word_break_characters = rl_basic_word_break_characters; #if defined (COLOR_SUPPORT) if (_rl_colored_stats || _rl_colored_completion_prefix) diff --git a/lib/readline/readline.h b/lib/readline/readline.h index 124f57b1..5f17dfd7 100644 --- a/lib/readline/readline.h +++ b/lib/readline/readline.h @@ -700,7 +700,7 @@ extern const char *rl_basic_word_break_characters; /* The list of characters that signal a break between words for rl_complete_internal. The default list is the contents of rl_basic_word_break_characters. */ -extern /*const*/ char *rl_completer_word_break_characters; +extern const char *rl_completer_word_break_characters; /* Hook function to allow an application to set the completion word break characters before readline breaks up the line. Allows @@ -961,7 +961,7 @@ struct readline_state { rl_compentry_func_t *menuentryfunc; rl_compignore_func_t *ignorefunc; rl_completion_func_t *attemptfunc; - char *wordbreakchars; + const char *wordbreakchars; /* options state */ diff --git a/lib/readline/rlmbutil.h b/lib/readline/rlmbutil.h index f5439ae9..d9060572 100644 --- a/lib/readline/rlmbutil.h +++ b/lib/readline/rlmbutil.h @@ -139,8 +139,7 @@ extern int _rl_walphabetic (WCHAR_T); /* Try and shortcut the printable ascii characters to cut down the number of calls to a libc wcwidth() */ static inline int -_rl_wcwidth (wc) - WCHAR_T wc; +_rl_wcwidth (WCHAR_T wc) { switch (wc) { diff --git a/lib/readline/text.c b/lib/readline/text.c index c06f7ef2..b16bc9bf 100644 --- a/lib/readline/text.c +++ b/lib/readline/text.c @@ -1135,7 +1135,7 @@ rl_newline (int count, int key) int rl_do_lowercase_version (int ignore1, int ignore2) { - return 0; + return 99999; /* prevent from being combined with _rl_null_function */ } /* This is different from what vi does, so the code's not shared. Emacs diff --git a/pcomplete.c b/pcomplete.c index fe1a0320..cccd4c95 100644 --- a/pcomplete.c +++ b/pcomplete.c @@ -1296,7 +1296,7 @@ command_line_to_word_list (line, llen, sentinel, nwp, cwp) int llen, sentinel, *nwp, *cwp; { WORD_LIST *ret; - char *delims; + const char *delims; #if 0 delims = "()<>;&| \t\n"; /* shell metacharacters break words */ diff --git a/subst.c b/subst.c index ff1b0d3e..a20855dd 100644 --- a/subst.c +++ b/subst.c @@ -2288,7 +2288,7 @@ WORD_LIST * split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) char *string; int slen; - char *delims; + const char *delims; int sentinel, flags; int *nwp, *cwp; { @@ -2305,7 +2305,7 @@ split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) return ((WORD_LIST *)NULL); } - d = (delims == 0) ? ifs_value : delims; + d = (delims == 0) ? ifs_value : (char *)delims; ifs_split = delims == 0; /* Make d2 the non-whitespace characters in delims */ diff --git a/subst.h b/subst.h index fb155dea..4dcd9d8e 100644 --- a/subst.h +++ b/subst.h @@ -326,7 +326,7 @@ extern int skip_to_histexp PARAMS((char *, int, char *, int)); #if defined (READLINE) extern int char_is_quoted PARAMS((char *, int)); extern int unclosed_pair PARAMS((char *, int, char *)); -extern WORD_LIST *split_at_delims PARAMS((char *, int, char *, int, int, int *, int *)); +extern WORD_LIST *split_at_delims PARAMS((char *, int, const char *, int, int, int *, int *)); #endif /* Variables used to keep track of the characters in IFS. */ diff --git a/variables.c b/variables.c index 7ede00cc..28d6f13c 100644 --- a/variables.c +++ b/variables.c @@ -1638,7 +1638,7 @@ assign_comp_wordbreaks (self, value, unused, key) { if (rl_completer_word_break_characters && rl_completer_word_break_characters != rl_basic_word_break_characters) - free (rl_completer_word_break_characters); + free ((void *)rl_completer_word_break_characters); rl_completer_word_break_characters = savestring (value); return self;