configure
- make sure to note in CHANGES that configure now supports
- --enable-year-2038 for large time_t
+ --enable-year2038 for large time_t
+
+ 5/14
+ ----
+pathexp.c
+ - glob_quote_char: new function, identify characters that should have
+ backslashes preserved when quoting a glob pattern. Currently has
+ all the glob_char_p characters plus `%' and `#' for pattern
+ substitution and removal.
+ Fixes issue reported by Andreas Schwab <schwab@suse.de>
+
+ 5/16
+ ----
+pcomplete.c
+ - programmable_completions: change to allow a newly-loaded compspec
+ (after a completion function returns 124) to be used in more cases
+ From a patch from Grisha Levit <grishalevit@gmail.com>
+
+mksyntax.c,version.c,support/bashversion.c
+ - include config.h if CROSS_COMPILING is not defined, assuming that
+ the build host and target host are the same
+
+buildconf.h.in
+ - if cross-compiling, define _POSIX_C_SOURCE and _XOPEN_SOURCE to
+ get the C90/1003.1-1992 compilation environment we assume
+ From a report from Grisha Levit <grishalevit@gmail.com>
+
+ 5/17
+ ----
+pathexp.c
+ - globsort_sizecmp,globsort_blockscmp: replace subtraction with a
+ generic transitive comparison function to avoid problems with
+ integer underflow
+ From a report from Grisha Levit <grishalevit@gmail.com>
+
fi
@${RM} pathnames.tmp
+buildconf.h: $(srcdir)/buildconf.h.in
+ CONFIG_FILES= CONFIG_HEADERS=buildconf.h $(SHELL) ./config.status
+
$(SDIR)/bashbug.sh: $(SDIR)/bashbug.sh.in
CONFIG_FILES=$(SDIR)/bashbug.sh CONFIG_HEADERS= $(SHELL) ./config.status
#if !defined (BUILDCONF_H_)
#define BUILDCONF_H_
-#undef HAVE_LOCALE_H
+/* assume C90/POSIX-1992 compilation environment if cross-compiling */
-#undef HAVE_UNISTD_H
+/* pacify glibc */
+#ifndef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 2
+# define _XOPEN_SOURCE 500
+#endif
-#undef HAVE_ISBLANK
+#define HAVE_LOCALE_H 1
+
+#define HAVE_UNISTD_H 1
+
+/* Don't assume this; it's from C99; let syntax.h define a replacement */
+/* #undef HAVE_ISBLANK */
#undef PROCESS_SUBSTITUTION
int
source_builtin (WORD_LIST *list)
{
- int result;
+ int result, search_cwd;
char *filename, *debug_trap, *x;
if (no_options (list))
}
#endif
+ search_cwd = source_searches_cwd;
+
filename = (char *)NULL;
/* XXX -- should this be absolute_pathname? */
if (posixly_correct && strchr (list->word->word, '/'))
}
if (filename == 0)
{
- if (source_searches_cwd == 0)
+ if (search_cwd == 0)
{
x = printable_filename (list->word->word, 0);
builtin_error (_("%s: file not found"), x);
#! /bin/sh
-# From configure.ac for Bash 5.3, version 5.063.
+# From configure.ac for Bash 5.3, version 5.064.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for bash 5.3-alpha.
#
-ac_fn_c_check_type "$LINENO" "u_int" "ac_cv_type_u_int" "$ac_includes_default"
-if test "x$ac_cv_type_u_int" = xyes
-then :
-
-else case e in #(
- e)
-printf "%s\n" "#define u_int unsigned int" >>confdefs.h
- ;;
-esac
-fi
-
-ac_fn_c_check_type "$LINENO" "u_long" "ac_cv_type_u_long" "$ac_includes_default"
-if test "x$ac_cv_type_u_long" = xyes
-then :
-
-else case e in #(
- e)
-printf "%s\n" "#define u_long unsigned long" >>confdefs.h
- ;;
-esac
-fi
-
-
if test "$ac_cv_sizeof_short" = 2; then
ac_fn_c_check_type "$LINENO" "bits16_t" "ac_cv_type_bits16_t" "$ac_includes_default"
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-AC_REVISION([for Bash 5.3, version 5.063])dnl
+AC_REVISION([for Bash 5.3, version 5.064])dnl
define(bashvers, 5.3)
define(relstatus, alpha)
AC_CHECK_SIZEOF(double, 8)
AC_CHECK_SIZEOF([long long], 8)
-AC_CHECK_TYPE(u_int, [unsigned int])
-AC_CHECK_TYPE(u_long, [unsigned long])
-
BASH_TYPE_BITS16_T
BASH_TYPE_U_BITS16_T
BASH_TYPE_BITS32_T
For example, a value of \fI\-mtime\fP sorts the results in descending
order by modification time (newest first).
A sort specifier of \fInosort\fP disables sorting completely; the results
-are returned in the order they are read from the file system,.
+are returned in the order they are read from the file system.
If the sort specifier is missing, it defaults to \fIname\fP,
so a value of \fI+\fP is equivalent to the null string,
and a value of \fI-\fP sorts by name in descending order.
order by modification time (newest first).
A sort specifier of @samp{nosort} disables sorting completely; the results
-are returned in the order they are read from the file system,.
+are returned in the order they are read from the file system.
If the sort specifier is missing, it defaults to @var{name},
so a value of @samp{+} is equivalent to the null string,
/*
- Copyright (C) 2020,2022,2023 Free Software Foundation, Inc.
+ Copyright (C) 2020,2022-2024 Free Software Foundation, Inc.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
/* Contributed by Geir Hauge <geir.hauge@gmail.com> */
+#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
+
#include <fcntl.h>
#include <errno.h>
* Ascii internet address interpretation routine.
* The value returned is in network order.
*/
-u_long
+in_addr_t
inet_addr(const char *cp)
{
struct in_addr val;
register u_bits32_t val;
register int base, n;
register unsigned char c;
- u_int parts[4];
- register u_int *pp = parts;
+ unsigned int parts[4];
+ register unsigned int *pp = parts;
c = *cp;
for (;;) {
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
-/* assume C90 compilation environment */
+/* assume C90/POSIX-1992 compilation environment if cross-compiling */
+
+#ifndef CROSS_COMPILING
+# include <config.h>
+#else
+# include <buildconf.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <buildconf.h>
-
#include "chartypes.h"
#include "syntax.h"
return 0;
}
+static inline int
+glob_quote_char (const char *s)
+{
+ return (glob_char_p (s) || (*s == '%') || (*s == '#'));
+}
+
/* PATHNAME can contain characters prefixed by CTLESC; this indicates
that the character is to be quoted. We quote it here in the style
that the glob library recognizes. If flags includes QGLOB_CVTNULL,
/* We don't have to backslash-quote non-special BRE characters if
we're quoting a glob pattern. */
- if (cc != CTLESC && (qflags & QGLOB_REGEXP) == 0 && glob_char_p (pathname+i+1) == 0)
+ if (cc != CTLESC && (qflags & QGLOB_REGEXP) == 0 && glob_quote_char (pathname+i+1) == 0)
continue;
/* If we're in a multibyte locale, don't bother quoting multibyte
return ((glob_sorttype < SORT_REVERSE) ? strvec_posixcmp (s1, s2) : strvec_posixcmp (s2, s1));
}
+/* Generic transitive comparison of two numeric values for qsort */
+#define GENCMP(a,b) (a < b ? -1 : (a > b ? 1 : 0))
+
static int
globsort_sizecmp (struct globsort_t *g1, struct globsort_t *g2)
{
- return ((glob_sorttype < SORT_REVERSE) ? g1->st.size - g2->st.size : g2->st.size - g1->st.size);
+ return ((glob_sorttype < SORT_REVERSE) ? GENCMP(g1->st.size, g2->st.size) : GENCMP(g2->st.size, g1->st.size));
}
static int
static int
globsort_blockscmp (struct globsort_t *g1, struct globsort_t *g2)
{
- return ((glob_sorttype < SORT_REVERSE) ? g1->st.blocks - g2->st.blocks : g2->st.blocks - g1->st.blocks);
+ return (glob_sorttype < SORT_REVERSE ? GENCMP(g1->st.blocks, g2->st.blocks) : GENCMP(g2->st.blocks, g1->st.blocks));
}
+#undef GENCMP
+
static struct globsort_t *
globsort_buildarray (char **array, size_t len)
{
#endif
lastcs = 0;
- found = count = 0;
+ count = 0;
pcomp_line = rl_line_buffer;
pcomp_ind = rl_point;
do
{
- retry = 0;
+ retry = found = 0;
/* We look at the basename of CMD if the full command does not have
an associated COMPSPEC. */
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <buildconf.h>
+/* assume C90/POSIX-1992 compilation environment if cross-compiling */
-/* assume C90 compilation environment */
+#ifndef CROSS_COMPILING
+# include <config.h>
+#else
+# include <buildconf.h>
+#endif
#include <stdio.h>
#include <string.h>
argv[1] = </>
argv[1] = </>
+1/##2/%3
+1/##2/##3
+1##2/%3
+1/%%2/#3
+1/%%2/%%3
+1%%2/#3
./new-exp.tests: line 1: ABXD: parameter unset
# caused core dumps because of bad bracket expression parsing in bash-5.0
eval : $'${x/#[0\xef\xbf\xbd\\Z[:]]}'
+a=1/%2/%3
+echo "${a/\%/##}"
+echo "${a//\%/##}"
+echo "${a/\/%/##}"
+
+b=1/#2/#3
+echo "${b/\#/%%}"
+echo "${b//\#/%%}"
+echo "${b/\/#/%%}"
+
+unset a b
+
expect $0: 'ABXD: parameter unset'
${THIS_SH} -c 'recho ${ABXD:?"parameter unset"}' $0
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <buildconf.h>
+/* assume C90/POSIX-1992 compilation environment if cross-compiling */
+
+#ifndef CROSS_COMPILING
+# include <config.h>
+#else
+# include <buildconf.h>
+#endif
#include <stdio.h>