minor fixes; readline API change for rl_completer_word_break_characters ; readline fixes for MSVC

This commit is contained in:
Chet Ramey
2021-08-19 15:48:31 -04:00
parent cf8298cb22
commit 2adf06d9f8
13 changed files with 68 additions and 18 deletions
+9
View File
@@ -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 == '"')
+3 -1
View File
@@ -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
+3 -2
View File
@@ -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;
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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 */
+1 -2
View File
@@ -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)
{
+1 -1
View File
@@ -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