bash-5.2-alpha release

This commit is contained in:
Chet Ramey
2022-01-20 15:06:05 -05:00
parent 9439ce094c
commit 4491c03014
409 changed files with 63491 additions and 54851 deletions
+10 -14
View File
@@ -1,6 +1,6 @@
/* chartypes.h -- extend ctype.h */
/* Copyright (C) 2001 Free Software Foundation, Inc.
/* Copyright (C) 2001-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -23,22 +23,18 @@
#include <ctype.h>
/* Jim Meyering writes:
#ifndef UCHAR_MAX
# define UCHAR_MAX 255
#endif
#ifndef CHAR_MAX
# define CHAR_MAX 127
#endif
"... Some ctype macros are valid only for character codes that
isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
using /bin/cc or gcc but without giving an ansi option). So, all
ctype uses should be through macros like ISPRINT... If
STDC_HEADERS is defined, then autoconf has verified that the ctype
macros don't need to be guarded with references to isascii. ...
Defining IN_CTYPE_DOMAIN to 1 should let any compiler worth its salt
eliminate the && through constant folding."
Solaris defines some of these symbols so we must undefine them first. */
#if STDC_HEADERS || (!defined (isascii) && !HAVE_ISASCII)
/* use this as a proxy for C89 */
#if defined (HAVE_STDLIB_H) && defined (HAVE_STRING_H)
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
# define IN_CTYPE_DOMAIN(c) ((c) >= 0 && (c) <= CHAR_MAX)
#endif
#if !defined (isspace) && !defined (HAVE_ISSPACE)
+1 -1
View File
@@ -1,6 +1,6 @@
/* posixdir.h -- Posix directory reading includes and defines. */
/* Copyright (C) 1987,1991,2012 Free Software Foundation, Inc.
/* Copyright (C) 1987,1991,2012,2019,2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+32 -9
View File
@@ -1,6 +1,6 @@
/* posixtime.h -- wrapper for time.h, sys/times.h mess. */
/* Copyright (C) 1999 Free Software Foundation, Inc.
/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -25,16 +25,10 @@
/* Some systems require this, mostly for the definition of `struct timezone'.
For example, Dynix/ptx has that definition in <time.h> rather than
sys/time.h */
#if defined (TIME_WITH_SYS_TIME)
#if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
# include <time.h>
#else
# if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include <time.h>
#if !defined (HAVE_SYSCONF) || !defined (_SC_CLK_TCK)
# if !defined (CLK_TCK)
@@ -58,4 +52,33 @@ struct timeval
extern int gettimeofday PARAMS((struct timeval *, void *));
#endif
/* These exist on BSD systems, at least. */
#if !defined (timerclear)
# define timerclear(tvp) do { (tvp)->tv_sec = 0; (tvp)->tv_usec = 0; } while (0)
#endif
#if !defined (timerisset)
# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#endif
#if !defined (timercmp)
# define timercmp(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) ? ((a)->tv_usec CMP (b)->tv_usec) \
: ((a)->tv_sec CMP (b)->tv_sec))
#endif
/* These are non-standard. */
#if !defined (timerisunset)
# define timerisunset(tvp) ((tvp)->tv_sec == 0 && (tvp)->tv_usec == 0)
#endif
#if !defined (timerset)
# define timerset(tvp, s, u) do { tvp->tv_sec = s; tvp->tv_usec = u; } while (0)
#endif
#ifndef TIMEVAL_TO_TIMESPEC
# define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#endif
#endif /* _POSIXTIME_H_ */
+1 -1
View File
@@ -1,5 +1,5 @@
/* Multibyte character data type.
Copyright (C) 2001, 2005-2007, 2009-2010 Free Software Foundation, Inc.
Copyright (C) 2001, 2005-2007, 2009-2010, 2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,7 +1,7 @@
/* stdc.h -- macros to make source compile on both ANSI C and K&R C
compilers. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
/* Copyright (C) 1993-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+64
View File
@@ -0,0 +1,64 @@
/* timer.h -- data structures used by the shell timers in lib/sh/timers.c */
/* Copyright (C) 2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bashjmp.h"
typedef struct _shtimer
{
struct timeval tmout;
int fd;
int flags;
int alrmflag; /* should be set by alrm_handler */
SigHandler *alrm_handler;
SigHandler *old_handler;
procenv_t jmpenv;
int (*tm_handler) (struct _shtimer *); /* called on timeout if set */
PTR_T *data; /* reserved */
} sh_timer;
#define SHTIMER_ALARM 0x01 /* mutually exclusive */
#define SHTIMER_SELECT 0x02
#define SHTIMER_LONGJMP 0x04
#define SHTIMER_SIGSET 0x100
#define SHTIMER_ALRMSET 0x200
extern sh_timer *shtimer_alloc (void);
extern void shtimer_flush (sh_timer *);
extern void shtimer_dispose (sh_timer *);
extern void shtimer_set (sh_timer *, time_t, long);
extern void shtimer_unset (sh_timer *);
extern void shtimer_cleanup (sh_timer *);
extern void shtimer_clear (sh_timer *);
extern int shtimer_chktimeout (sh_timer *);
extern int shtimer_select (sh_timer *);
extern int shtimer_alrm (sh_timer *);
+15 -5
View File
@@ -1,6 +1,6 @@
/* typemax.h -- encapsulate max values for long, long long, etc. */
/* Copyright (C) 2001 Free Software Foundation, Inc.
/* Copyright (C) 2001-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -54,7 +54,7 @@
: ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
#endif
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG_INT
# ifndef LLONG_MAX
# define LLONG_MAX TYPE_MAXIMUM(long long int)
# define LLONG_MIN TYPE_MINIMUM(long long int)
@@ -79,8 +79,18 @@
# define UINT_MAX ((unsigned int) ~(unsigned int)0)
#endif
#ifndef SHRT_MAX
# define SHRT_MAX TYPE_MAXIMUM(short)
# define SHRT_MIN TYPE_MINIMUM(short)
# define USHRT_MAX ((unsigned short) ~(unsigned short)0)
#endif
#ifndef UCHAR_MAX
# define UCHAR_MAX 255
#endif
/* workaround for gcc bug in versions < 2.7 */
#if defined (HAVE_LONG_LONG) && __GNUC__ == 2 && __GNUC_MINOR__ < 7
#if defined (HAVE_LONG_LONG_INT) && __GNUC__ == 2 && __GNUC_MINOR__ < 7
static const unsigned long long int maxquad = ULLONG_MAX;
# undef ULLONG_MAX
# define ULLONG_MAX maxquad
@@ -102,11 +112,11 @@ static const unsigned long long int maxquad = ULLONG_MAX;
#endif
#ifndef SSIZE_MAX
# define SSIZE_MAX 32767 /* POSIX minimum max */
# define SSIZE_MAX INT_MAX
#endif
#ifndef SIZE_MAX
# define SIZE_MAX 65535 /* POSIX minimum max */
# define SIZE_MAX ((size_t) ~(size_t)0)
#endif
#ifndef sh_imaxabs