mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-14 07:30:49 +02:00
fix comsub inside parameter expansion in here-document; fix readline longjmp botch; posix change for unset non-identifier; posix change for double quotes inside backquote comsub in here-document; add missing posix pieces to umask builtin
This commit is contained in:
@@ -2732,7 +2732,6 @@ int
|
||||
rl_forced_update_display (void)
|
||||
{
|
||||
register char *temp;
|
||||
register int tlen;
|
||||
|
||||
if (visible_line)
|
||||
memset (visible_line, 0, line_size);
|
||||
|
||||
@@ -70,12 +70,12 @@ static int subst_rhs_len;
|
||||
specifications from word designators. Static for now */
|
||||
static char *history_event_delimiter_chars = HISTORY_EVENT_DELIMITERS;
|
||||
|
||||
static char *get_history_word_specifier (char *, char *, int *);
|
||||
static char *get_history_word_specifier (const char *, char *, int *);
|
||||
static int history_tokenize_word (const char *, int);
|
||||
static char **history_tokenize_internal (const char *, int, int *);
|
||||
static char *history_substring (const char *, int, int);
|
||||
static void freewords (char **, int);
|
||||
static char *history_find_word (char *, int);
|
||||
static char *history_find_word (const char *, int);
|
||||
|
||||
static char *quote_breaks (char *);
|
||||
|
||||
@@ -319,7 +319,7 @@ get_history_event (const char *string, int *caller_index, int delimiting_quote)
|
||||
to the closing single quote. FLAGS currently used to allow backslash
|
||||
to escape a single quote (e.g., for bash $'...'). */
|
||||
static void
|
||||
hist_string_extract_single_quoted (char *string, int *sindex, int flags)
|
||||
hist_string_extract_single_quoted (const char *string, int *sindex, int flags)
|
||||
{
|
||||
register int i;
|
||||
|
||||
@@ -374,7 +374,7 @@ quote_breaks (char *s)
|
||||
}
|
||||
|
||||
static char *
|
||||
hist_error(char *s, int start, int current, int errtype)
|
||||
hist_error(const char *s, int start, int current, int errtype)
|
||||
{
|
||||
char *temp;
|
||||
const char *emsg;
|
||||
@@ -434,7 +434,7 @@ hist_error(char *s, int start, int current, int errtype)
|
||||
subst_rhs is allowed to be set to the empty string. */
|
||||
|
||||
static char *
|
||||
get_subst_pattern (char *str, int *iptr, int delimiter, int is_rhs, int *lenptr)
|
||||
get_subst_pattern (const char *str, int *iptr, int delimiter, int is_rhs, int *lenptr)
|
||||
{
|
||||
register int si, i, j, k;
|
||||
char *s;
|
||||
@@ -527,7 +527,7 @@ postproc_subst_rhs (void)
|
||||
*END_INDEX_PTR, and the expanded specifier in *RET_STRING. */
|
||||
/* need current line for !# */
|
||||
static int
|
||||
history_expand_internal (char *string, int start, int qc, int *end_index_ptr, char **ret_string, char *current_line)
|
||||
history_expand_internal (const char *string, int start, int qc, int *end_index_ptr, char **ret_string, char *current_line)
|
||||
{
|
||||
int i, n, starting_index;
|
||||
int substitute_globally, subst_bywords, want_quotes, print_only;
|
||||
@@ -1303,7 +1303,7 @@ history_expand (char *hstring, char **output)
|
||||
CALLER_INDEX is the offset in SPEC to start looking; it is updated
|
||||
to point to just after the last character parsed. */
|
||||
static char *
|
||||
get_history_word_specifier (char *spec, char *from, int *caller_index)
|
||||
get_history_word_specifier (const char *spec, char *from, int *caller_index)
|
||||
{
|
||||
register int i = *caller_index;
|
||||
int first, last;
|
||||
@@ -1696,7 +1696,7 @@ freewords (char **words, int start)
|
||||
in the history line LINE. Used to save the word matched by the
|
||||
last history !?string? search. */
|
||||
static char *
|
||||
history_find_word (char *line, int ind)
|
||||
history_find_word (const char *line, int ind)
|
||||
{
|
||||
char **words, *s;
|
||||
int i, wind;
|
||||
|
||||
+12
-12
@@ -148,7 +148,7 @@ _rl_utf8_mblen (const char *s, size_t n)
|
||||
}
|
||||
|
||||
static int
|
||||
_rl_find_next_mbchar_internal (char *string, int seed, int count, int find_non_zero)
|
||||
_rl_find_next_mbchar_internal (const char *string, int seed, int count, int find_non_zero)
|
||||
{
|
||||
size_t tmp, len;
|
||||
mbstate_t ps;
|
||||
@@ -228,7 +228,7 @@ _rl_find_next_mbchar_internal (char *string, int seed, int count, int find_non_z
|
||||
}
|
||||
|
||||
static inline int
|
||||
_rl_test_nonzero (char *string, int ind, int len)
|
||||
_rl_test_nonzero (const char *string, int ind, int len)
|
||||
{
|
||||
size_t tmp;
|
||||
WCHAR_T wc;
|
||||
@@ -242,7 +242,7 @@ _rl_test_nonzero (char *string, int ind, int len)
|
||||
|
||||
/* experimental -- needs to handle zero-width characters better */
|
||||
static int
|
||||
_rl_find_prev_utf8char (char *string, int seed, int find_non_zero)
|
||||
_rl_find_prev_utf8char (const char *string, int seed, int find_non_zero)
|
||||
{
|
||||
char *s;
|
||||
unsigned char b;
|
||||
@@ -288,7 +288,7 @@ _rl_find_prev_utf8char (char *string, int seed, int find_non_zero)
|
||||
}
|
||||
|
||||
/*static*/ int
|
||||
_rl_find_prev_mbchar_internal (char *string, int seed, int find_non_zero)
|
||||
_rl_find_prev_mbchar_internal (const char *string, int seed, int find_non_zero)
|
||||
{
|
||||
mbstate_t ps;
|
||||
int prev, non_zero_prev, point, length;
|
||||
@@ -356,7 +356,7 @@ _rl_find_prev_mbchar_internal (char *string, int seed, int find_non_zero)
|
||||
if an invalid multibyte sequence was encountered. It returns (size_t)(-2)
|
||||
if it couldn't parse a complete multibyte character. */
|
||||
int
|
||||
_rl_get_char_len (char *src, mbstate_t *ps)
|
||||
_rl_get_char_len (const char *src, mbstate_t *ps)
|
||||
{
|
||||
size_t tmp, l;
|
||||
int mb_cur_max;
|
||||
@@ -368,7 +368,7 @@ _rl_get_char_len (char *src, mbstate_t *ps)
|
||||
else
|
||||
{
|
||||
mb_cur_max = MB_CUR_MAX;
|
||||
tmp = mbrlen((const char *)src, (l < mb_cur_max) ? l : mb_cur_max, ps);
|
||||
tmp = mbrlen(src, (l < mb_cur_max) ? l : mb_cur_max, ps);
|
||||
}
|
||||
if (tmp == (size_t)(-2))
|
||||
{
|
||||
@@ -394,7 +394,7 @@ _rl_get_char_len (char *src, mbstate_t *ps)
|
||||
/* compare the specified two characters. If the characters matched,
|
||||
return 1. Otherwise return 0. */
|
||||
int
|
||||
_rl_compare_chars (char *buf1, int pos1, mbstate_t *ps1, char *buf2, int pos2, mbstate_t *ps2)
|
||||
_rl_compare_chars (const char *buf1, int pos1, mbstate_t *ps1, const char *buf2, int pos2, mbstate_t *ps2)
|
||||
{
|
||||
int i, w1, w2;
|
||||
|
||||
@@ -417,7 +417,7 @@ _rl_compare_chars (char *buf1, int pos1, mbstate_t *ps1, char *buf2, int pos2, m
|
||||
if point is invalid (point < 0 || more than string length),
|
||||
it returns -1 */
|
||||
int
|
||||
_rl_adjust_point (char *string, int point, mbstate_t *ps)
|
||||
_rl_adjust_point (const char *string, int point, mbstate_t *ps)
|
||||
{
|
||||
size_t tmp;
|
||||
int length, pos;
|
||||
@@ -457,7 +457,7 @@ _rl_adjust_point (char *string, int point, mbstate_t *ps)
|
||||
}
|
||||
|
||||
int
|
||||
_rl_is_mbchar_matched (char *string, int seed, int end, char *mbchar, int length)
|
||||
_rl_is_mbchar_matched (const char *string, int seed, int end, char *mbchar, int length)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -471,7 +471,7 @@ _rl_is_mbchar_matched (char *string, int seed, int end, char *mbchar, int length
|
||||
}
|
||||
|
||||
WCHAR_T
|
||||
_rl_char_value (char *buf, int ind)
|
||||
_rl_char_value (const char *buf, int ind)
|
||||
{
|
||||
size_t tmp;
|
||||
WCHAR_T wc;
|
||||
@@ -500,7 +500,7 @@ _rl_char_value (char *buf, int ind)
|
||||
characters. */
|
||||
#undef _rl_find_next_mbchar
|
||||
int
|
||||
_rl_find_next_mbchar (char *string, int seed, int count, int flags)
|
||||
_rl_find_next_mbchar (const char *string, int seed, int count, int flags)
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
return _rl_find_next_mbchar_internal (string, seed, count, flags);
|
||||
@@ -514,7 +514,7 @@ _rl_find_next_mbchar (char *string, int seed, int count, int flags)
|
||||
we look for non-zero-width multibyte characters. */
|
||||
#undef _rl_find_prev_mbchar
|
||||
int
|
||||
_rl_find_prev_mbchar (char *string, int seed, int flags)
|
||||
_rl_find_prev_mbchar (const char *string, int seed, int flags)
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
return _rl_find_prev_mbchar_internal (string, seed, flags);
|
||||
|
||||
@@ -590,7 +590,8 @@ readline_internal_charloop (void)
|
||||
{
|
||||
(*rl_redisplay_function) ();
|
||||
_rl_want_redisplay = 0;
|
||||
memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
||||
memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
|
||||
|
||||
/* If we longjmped because of a timeout, handle it here. */
|
||||
if (RL_ISSTATE (RL_STATE_TIMEOUT))
|
||||
|
||||
@@ -104,21 +104,21 @@
|
||||
#define MB_FIND_ANY 0x00
|
||||
#define MB_FIND_NONZERO 0x01
|
||||
|
||||
extern int _rl_find_prev_mbchar (char *, int, int);
|
||||
extern int _rl_find_next_mbchar (char *, int, int, int);
|
||||
extern int _rl_find_prev_mbchar (const char *, int, int);
|
||||
extern int _rl_find_next_mbchar (const char *, int, int, int);
|
||||
|
||||
#ifdef HANDLE_MULTIBYTE
|
||||
|
||||
extern int _rl_compare_chars (char *, int, mbstate_t *, char *, int, mbstate_t *);
|
||||
extern int _rl_get_char_len (char *, mbstate_t *);
|
||||
extern int _rl_adjust_point (char *, int, mbstate_t *);
|
||||
extern int _rl_compare_chars (const char *, int, mbstate_t *, const char *, int, mbstate_t *);
|
||||
extern int _rl_get_char_len (const char *, mbstate_t *);
|
||||
extern int _rl_adjust_point (const char *, int, mbstate_t *);
|
||||
|
||||
extern int _rl_read_mbchar (char *, int);
|
||||
extern int _rl_read_mbstring (int, char *, int);
|
||||
|
||||
extern int _rl_is_mbchar_matched (char *, int, int, char *, int);
|
||||
extern int _rl_is_mbchar_matched (const char *, int, int, char *, int);
|
||||
|
||||
extern WCHAR_T _rl_char_value (char *, int);
|
||||
extern WCHAR_T _rl_char_value (const char *, int);
|
||||
extern int _rl_walphabetic (WCHAR_T);
|
||||
|
||||
#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc))
|
||||
|
||||
Reference in New Issue
Block a user