mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 02:02:42 +02:00
Bash-5.2-rc1 release
This commit is contained in:
+1
-1
@@ -121,7 +121,7 @@ void wcdequote_pathname PARAMS((wchar_t *));
|
||||
static void wdequote_pathname PARAMS((char *));
|
||||
static void dequote_pathname PARAMS((char *));
|
||||
#else
|
||||
# define dequote_pathname udequote_pathname
|
||||
# define dequote_pathname(p) udequote_pathname(p)
|
||||
#endif
|
||||
static int glob_testdir PARAMS((char *, int));
|
||||
static char **glob_dir_to_array PARAMS((char *, char **, int));
|
||||
|
||||
@@ -32,6 +32,11 @@
|
||||
|
||||
#define MALLOC_WRAPFUNCS
|
||||
|
||||
/* If defined, as it is by default, use the lesscore() function to attempt
|
||||
to reduce the top of the heap when freeing memory blocks larger than a
|
||||
defined threshold. */
|
||||
#define USE_LESSCORE
|
||||
|
||||
/* Generic pointer type. */
|
||||
#ifndef PTR_T
|
||||
# if defined (__STDC__)
|
||||
|
||||
+5
-4
@@ -597,6 +597,7 @@ _malloc_unblock_signals (setp, osetp)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (USE_LESSCORE)
|
||||
/* Return some memory to the system by reducing the break. This is only
|
||||
called with NU > pagebucket, so we're always assured of giving back
|
||||
more than one page of memory. */
|
||||
@@ -617,6 +618,7 @@ lesscore (nu) /* give system back some memory */
|
||||
_mstats.nlesscore[nu]++;
|
||||
#endif
|
||||
}
|
||||
#endif /* USE_LESSCORE */
|
||||
|
||||
/* Ask system for more memory; add to NEXTF[NU]. BUSY[NU] must be set to 1. */
|
||||
static void
|
||||
@@ -1024,11 +1026,9 @@ internal_free (mem, file, line, flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if GLIBC21
|
||||
if (nunits >= LESSCORE_MIN && ((char *)p + binsize(nunits) == sbrk (0)))
|
||||
#else
|
||||
#if defined (USE_LESSCORE)
|
||||
/* We take care of the mmap case and munmap above */
|
||||
if (nunits >= LESSCORE_MIN && ((char *)p + binsize(nunits) == memtop))
|
||||
#endif
|
||||
{
|
||||
/* If above LESSCORE_FRC, give back unconditionally. This should be set
|
||||
high enough to be infrequently encountered. If between LESSCORE_MIN
|
||||
@@ -1041,6 +1041,7 @@ internal_free (mem, file, line, flags)
|
||||
goto free_return;
|
||||
}
|
||||
}
|
||||
#endif /* USE_LESSCORE */
|
||||
|
||||
#ifdef MEMSCRAMBLE
|
||||
if (p->mh_nbytes)
|
||||
|
||||
@@ -279,8 +279,11 @@ rl_callback_read_char (void)
|
||||
}
|
||||
|
||||
/* Make sure application hooks can see whether we saw EOF. */
|
||||
if (rl_eof_found = eof)
|
||||
RL_SETSTATE(RL_STATE_EOF);
|
||||
if (eof > 0)
|
||||
{
|
||||
rl_eof_found = eof;
|
||||
RL_SETSTATE(RL_STATE_EOF);
|
||||
}
|
||||
|
||||
if (rl_done)
|
||||
{
|
||||
|
||||
@@ -2368,6 +2368,7 @@ history list.
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
|
||||
#if defined (HAVE_STRING_H)
|
||||
# include <string.h>
|
||||
@@ -2448,6 +2449,8 @@ main (argc, argv)
|
||||
@{
|
||||
char *line, *s;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
progname = argv[0];
|
||||
|
||||
initialize_readline (); /* Bind our completer. */
|
||||
|
||||
@@ -50,6 +50,8 @@ Copyright (C) 1999 Jeff Solomon
|
||||
#include <stdio.h>
|
||||
#include <termios.h> /* xxx - should make this more general */
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef READLINE_LIBRARY
|
||||
# include "readline.h"
|
||||
#else
|
||||
@@ -104,6 +106,8 @@ main()
|
||||
{
|
||||
fd_set fds;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
/* Adjust the terminal slightly before the handler is installed. Disable
|
||||
* canonical mode processing and set the input character time flag to be
|
||||
* non-blocking.
|
||||
|
||||
@@ -27,8 +27,11 @@
|
||||
# include <readline/history.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
@@ -7,9 +7,13 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
/* Standard readline include files. */
|
||||
#if defined (READLINE_LIBRARY)
|
||||
# include "readline.h"
|
||||
@@ -22,10 +26,19 @@
|
||||
extern int errno;
|
||||
|
||||
static void cb_linehandler (char *);
|
||||
static void signandler (int);
|
||||
|
||||
int running;
|
||||
int running, sigwinch_received;
|
||||
const char *prompt = "rltest$ ";
|
||||
|
||||
/* Handle SIGWINCH and window size changes when readline is not active and
|
||||
reading a character. */
|
||||
static void
|
||||
sighandler (int sig)
|
||||
{
|
||||
sigwinch_received = 1;
|
||||
}
|
||||
|
||||
/* Callback function called for each line when accept-line executed, EOF
|
||||
seen, or EOF character read. This sets a flag and returns; it could
|
||||
also call exit(3). */
|
||||
@@ -60,6 +73,11 @@ main (int c, char **v)
|
||||
fd_set fds;
|
||||
int r;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
/* Handle SIGWINCH */
|
||||
signal (SIGWINCH, sighandler);
|
||||
|
||||
/* Install the line handler. */
|
||||
rl_callback_handler_install (prompt, cb_linehandler);
|
||||
|
||||
@@ -80,6 +98,13 @@ main (int c, char **v)
|
||||
rl_callback_handler_remove ();
|
||||
break;
|
||||
}
|
||||
if (sigwinch_received)
|
||||
{
|
||||
rl_resize_terminal ();
|
||||
sigwinch_received = 0;
|
||||
}
|
||||
if (r < 0)
|
||||
continue;
|
||||
|
||||
if (FD_ISSET (fileno (rl_instream), &fds))
|
||||
rl_callback_read_char ();
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
extern void exit();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#if defined (READLINE_LIBRARY)
|
||||
# include "posixstat.h"
|
||||
# include "readline.h"
|
||||
@@ -93,6 +97,10 @@ main (argc, argv)
|
||||
else
|
||||
progname++;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
/* defaults */
|
||||
prompt = "readline$ ";
|
||||
fd = nch = 0;
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
extern void exit();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -79,6 +83,10 @@ main (argc, argv)
|
||||
char *temp;
|
||||
int opt, Vflag, Nflag;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, ""):
|
||||
#endif
|
||||
|
||||
progname = strrchr(argv[0], '/');
|
||||
if (progname == 0)
|
||||
progname = argv[0];
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
extern void exit();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef READLINE_LIBRARY
|
||||
# include "readline.h"
|
||||
# include "history.h"
|
||||
@@ -52,6 +56,10 @@ main ()
|
||||
char *temp, *prompt;
|
||||
int done;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
temp = (char *)NULL;
|
||||
prompt = "readline$ ";
|
||||
done = 0;
|
||||
|
||||
@@ -79,7 +79,7 @@ extern int errno;
|
||||
# define O_NDELAY O_NONBLOCK /* Posix style */
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_PSELECT)
|
||||
#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
|
||||
extern sigset_t _rl_orig_sigset;
|
||||
#endif
|
||||
|
||||
|
||||
+7
-7
@@ -167,8 +167,8 @@ getdtablesize ()
|
||||
# endif
|
||||
void
|
||||
bcopy (s,d,n)
|
||||
char *d, *s;
|
||||
int n;
|
||||
void *d, *s;
|
||||
size_t n;
|
||||
{
|
||||
FASTCOPY (s, d, n);
|
||||
}
|
||||
@@ -180,8 +180,8 @@ bcopy (s,d,n)
|
||||
# endif
|
||||
void
|
||||
bzero (s, n)
|
||||
char *s;
|
||||
int n;
|
||||
void *s;
|
||||
size_t n;
|
||||
{
|
||||
register int i;
|
||||
register char *r;
|
||||
@@ -197,7 +197,7 @@ bzero (s, n)
|
||||
int
|
||||
gethostname (name, namelen)
|
||||
char *name;
|
||||
int namelen;
|
||||
size_t namelen;
|
||||
{
|
||||
int i;
|
||||
struct utsname ut;
|
||||
@@ -214,7 +214,7 @@ gethostname (name, namelen)
|
||||
int
|
||||
gethostname (name, namelen)
|
||||
char *name;
|
||||
int namelen;
|
||||
size_t namelen;
|
||||
{
|
||||
strncpy (name, "unknown", namelen);
|
||||
name[namelen] = '\0';
|
||||
@@ -237,7 +237,7 @@ killpg (pgrp, sig)
|
||||
int
|
||||
mkfifo (path, mode)
|
||||
char *path;
|
||||
int mode;
|
||||
mode_t mode;
|
||||
{
|
||||
#if defined (S_IFIFO)
|
||||
return (mknod (path, (mode | S_IFIFO), 0));
|
||||
|
||||
+13
-4
@@ -2,7 +2,7 @@
|
||||
* shmatch.c -- shell interface to posix regular expression matching.
|
||||
*/
|
||||
|
||||
/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
|
||||
extern int glob_ignore_case, match_ignore_case;
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
extern SHELL_VAR *builtin_find_indexed_array (char *, int);
|
||||
#endif
|
||||
|
||||
int
|
||||
sh_regmatch (string, pattern, flags)
|
||||
const char *string;
|
||||
@@ -92,11 +96,16 @@ sh_regmatch (string, pattern, flags)
|
||||
/* Store the parenthesized subexpressions in the array BASH_REMATCH.
|
||||
Element 0 is the portion that matched the entire regexp. Element 1
|
||||
is the part that matched the first subexpression, and so on. */
|
||||
unbind_variable_noref ("BASH_REMATCH");
|
||||
#if 1
|
||||
unbind_global_variable_noref ("BASH_REMATCH");
|
||||
rematch = make_new_array_variable ("BASH_REMATCH");
|
||||
amatch = array_cell (rematch);
|
||||
#else
|
||||
/* TAG:bash-5.3 */
|
||||
rematch = builtin_find_indexed_array ("BASH_REMATCH", 1);
|
||||
#endif
|
||||
amatch = rematch ? array_cell (rematch) : (ARRAY *)0;
|
||||
|
||||
if (matches && (flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
|
||||
if (matches && amatch && (flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
|
||||
{
|
||||
for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,11 @@ sh_charvis (s, sindp, slen, ret, rindp)
|
||||
ri = *rindp;
|
||||
c = s[*sindp];
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
send = (locale_mb_cur_max > 1) ? s + slen : 0;
|
||||
#else
|
||||
send = 0;
|
||||
#endif
|
||||
|
||||
if (SAFECHAR (c))
|
||||
{
|
||||
@@ -88,10 +92,12 @@ sh_charvis (s, sindp, slen, ret, rindp)
|
||||
ret[ri++] = UNCTRL (c);
|
||||
si++;
|
||||
}
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
else if (locale_utf8locale && (c & 0x80))
|
||||
COPY_CHAR_I (ret, ri, s, send, si);
|
||||
else if (locale_mb_cur_max > 1 && is_basic (c) == 0)
|
||||
COPY_CHAR_I (ret, ri, s, send, si);
|
||||
#endif
|
||||
else if (META_CHAR (c))
|
||||
{
|
||||
ret[ri++] = 'M';
|
||||
|
||||
+2
-1
@@ -68,7 +68,8 @@ zgetline (fd, lineptr, n, delim, unbuffered_read)
|
||||
int delim;
|
||||
int unbuffered_read;
|
||||
{
|
||||
int nr, retval;
|
||||
int retval;
|
||||
size_t nr;
|
||||
char *line, c;
|
||||
|
||||
if (lineptr == 0 || n == 0 || (*lineptr == 0 && *n != 0))
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ zmapfd (fd, ostr, fn)
|
||||
int rval;
|
||||
char lbuf[ZBUFSIZ];
|
||||
char *result;
|
||||
int rsize, rind;
|
||||
size_t rsize, rind;
|
||||
|
||||
rval = 0;
|
||||
result = (char *)xmalloc (rsize = ZBUFSIZ);
|
||||
|
||||
Reference in New Issue
Block a user