mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 04:10:49 +02:00
fix typo in readline custom LS_COLORS extension; fix so `time' is recognized as a reserved word after $( and ${; don't run traps while parsing a command substitution
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Modified by Chet Ramey for Readline.
|
||||
|
||||
Copyright (C) 1985, 1988, 1990-1991, 1995-2021
|
||||
Copyright (C) 1985, 1988, 1990-1991, 1995-2021, 2023
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -73,7 +73,7 @@
|
||||
static bool is_colored (enum indicator_no type);
|
||||
static void restore_default_color (void);
|
||||
|
||||
#define RL_COLOR_PREFIX_EXTENSION "readline-colored-completion-prefix"
|
||||
#define RL_COLOR_PREFIX_EXTENSION ".readline-colored-completion-prefix"
|
||||
|
||||
COLOR_EXT_TYPE *_rl_color_ext_list = 0;
|
||||
|
||||
|
||||
@@ -297,6 +297,22 @@ get_funky_string (char **dest, const char **src, bool equals_end, size_t *output
|
||||
}
|
||||
#endif /* COLOR_SUPPORT */
|
||||
|
||||
static void
|
||||
free_color_ext_list (void)
|
||||
{
|
||||
COLOR_EXT_TYPE *e;
|
||||
COLOR_EXT_TYPE *e2;
|
||||
|
||||
for (e = _rl_color_ext_list; e != NULL; /* empty */)
|
||||
{
|
||||
e2 = e;
|
||||
e = e->next;
|
||||
free (e2);
|
||||
}
|
||||
|
||||
_rl_color_ext_list = 0;
|
||||
}
|
||||
|
||||
void _rl_parse_colors(void)
|
||||
{
|
||||
#if defined (COLOR_SUPPORT)
|
||||
@@ -420,21 +436,32 @@ void _rl_parse_colors(void)
|
||||
|
||||
if (state < 0)
|
||||
{
|
||||
COLOR_EXT_TYPE *e;
|
||||
COLOR_EXT_TYPE *e2;
|
||||
|
||||
_rl_errmsg ("unparsable value for LS_COLORS environment variable");
|
||||
free (color_buf);
|
||||
for (e = _rl_color_ext_list; e != NULL; /* empty */)
|
||||
{
|
||||
e2 = e;
|
||||
e = e->next;
|
||||
free (e2);
|
||||
}
|
||||
_rl_color_ext_list = NULL;
|
||||
free_color_ext_list ();
|
||||
|
||||
_rl_colored_stats = 0; /* can't have colored stats without colors */
|
||||
_rl_colored_completion_prefix = 0; /* or colored prefixes */
|
||||
}
|
||||
#else /* !COLOR_SUPPORT */
|
||||
;
|
||||
#endif /* !COLOR_SUPPORT */
|
||||
}
|
||||
|
||||
void
|
||||
rl_reparse_colors (void)
|
||||
{
|
||||
char *v;
|
||||
|
||||
v = sh_get_env_value ("LS_COLORS");
|
||||
if (v == 0 && color_buf == 0)
|
||||
return; /* no change */
|
||||
if (v && color_buf && STREQ (v, color_buf))
|
||||
return; /* no change */
|
||||
|
||||
free (color_buf);
|
||||
free_color_ext_list ();
|
||||
|
||||
_rl_parse_colors ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user