doc/bashref.texi
- Posix mode: remove item about function names being valid shell
identifiers
+
+ 10/25
+ -----
+aclocal.m4
+ - simplify the checks for the various members of struct dirent
+ Report and patch from Grisha Levit <grishalevit@gmail.com>
+
+m4/strtoimax.m4
+ - simplify and remove redundant caching and cache check
+ Report and patch from Grisha Levit <grishalevit@gmail.com>
+
+builtins/common.c
+ - get_exitstat: make the behavior of exit with no arguments
+ running in a trap action the same as return: check for any trap
+ (running_trap > 0) in the current execution_context. This is
+ POSIX interp 1602, in POSIX.1-2024
+
+stringlib.c
+ - find_token_in_alist: if FLAGS is non-zero, do *no* allocate new
+ memory for the token. The existing behavior is to allocate memory
+ and return a copy of the token, and all callers pass 0
+
+parse.y
+ - compoundcmd_lineno: now an array of `struct tokeninfo', which
+ has line number and current compound command information
+ - change compoundcmd_lineno[compoundcmd_top] to
+ compoundcmd_lineno[compoundcmd_top].lineno in all calls
+ - set_compoundcmd_top: in addition to assigning line number info,
+ assign T to compoundcmd_lineno[compoundcmd_top].token
+ - report_syntax_error: if we get a syntax error while looking for
+ shell_eof_token (comsubs), include the token we were looking for
+ in the error message
+ - report_syntax_error: if we are reporting an unexpected EOF error,
+ and compoundcmd_top >= 0, look up the token for the compound
+ command we're parsing, including `(', and change the error message
+ to include it
+
+ 10/26
+ -----
+Makefile.in
+ - PURIFY,GLOBC,GLOBO,ALLOC_FILES,LIBRARY_SOURCE: remove
+ - ADDON_CFLAGS,ADDON_LDDFLAGS: initialize to empty
+ - GRAM_H: remove from HSOURCES
+ - profiling-tests: use Program instead of PROGRAM
+
+builtins/Makefile.in
+ - DEBUG: initialize from configure
+ - SYSTEM_FLAGS: remove, since it's not passed from topdir Makefile
+ - ADDON_CFLAGS: initialize to empty
+
+lib/glob/Makefile.in
+ - ADDON_CFLAGS: initialize to empty
+
+lib/readline/Makefile.in
+ - ADDON_CFLAGS: initialize to empty
+ - APP_CFLAGS: remove
+
+lib/sh/Makefile.in
+ - DEBUG: initialize from configure
+ - ADDON_CFLAGS: initialize to empty
+ - LIBOBJDIR: initialize to empty; configure uses it in LIBOBJS
+
+lib/tilde/Makefile.in
+ - ADDON_CFLAGS: initialize to empty
+ - CCFLAGS: add ADDON_CFLAGS, replacing ASAN_CFLAGS
+
+support/Makefile.in
+ - SYSTEM_FLAGS: remove, since it's not passed from topdir Makefile
+
+ Makefiles report and patch from Grisha Levit <grishalevit@gmail.com>
+
+version.c,shell.h
+ - default_compatibility_level: int variable, initialized to
+ DEFAULT_COMPAT_LEVEL like shell_compatibility_level
+
+variables.c
+ - sv_shcompat: use default_compatibility_level instead of
+ DEFAULT_COMPAT_LEVEL so variables.o doesn't have to depend on
+ version.h
+
+builtins/shopt.def
+ - set_compatibility_level: use default_compatibility_level instead
+ of DEFAULT_COMPAT_LEVEL so shopt.o doesn't have to depend on
+ version.h
+ - don't include version.h any more
+
+configure.ac,Makefile.in,support/Makefile.in,doc/Makefile.in
+ - remove some unused variables: BASE_CFLAGS_FOR_BUILD, DEBUGGER_DIR,
+ INTLOBJS, TEXINDEX, TEX, MALLOC, SIGNAMES_SUPPORT
+ From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
-# Makefile for bash-5.3, version 5.6
+# Makefile for bash-5.3, version 5.7
#
# Copyright (C) 1996-2024 Free Software Foundation, Inc.
DEBUGGER_START_FILE = @DEBUGGER_START_FILE@
-#If you have purify, and want to use it, run the make as `make PURIFY=purify'
-#PURIFY = @PURIFY@
-
# Here is a rule for making .o files from .c files that does not
# force the type of the machine (like -M_MACHINE) into the flags.
.c.o:
SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS)
+BASH_MAKEFLAGS =
+
+# set by lint/sanitize targets
+ADDON_CFLAGS =
+ADDON_LDFLAGS =
+
BASE_CCFLAGS = $(SYSTEM_FLAGS) $(LOCAL_DEFS) \
$(DEFS) $(LOCAL_CFLAGS) $(INCLUDES) $(STYLE_CFLAGS)
LIBINTL = @LIBINTL@
LTLIBINTL = @LTLIBINTL@
INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
# Our malloc.
MALLOC_TARGET = @MALLOC_TARGET@
# The main source code for the Bourne Again SHell.
CSOURCES = shell.c eval.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
- dispose_cmd.c execute_cmd.c variables.c $(GLOBC) version.c \
+ dispose_cmd.c execute_cmd.c variables.c version.c \
expr.c copy_cmd.c flags.c subst.c hashcmd.c hashlib.c mailcheck.c \
- test.c trap.c alias.c jobs.c nojobs.c $(ALLOC_FILES) braces.c \
+ test.c trap.c alias.c jobs.c nojobs.c braces.c \
input.c bashhist.c array.c arrayfunc.c assoc.c sig.c pathexp.c \
unwind_prot.c siglist.c bashline.c bracecomp.c error.c \
list.c stringlib.c locale.c findcmd.c redir.c \
HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \
general.h variables.h config.h $(ALLOC_HEADERS) alias.h \
- quit.h unwind_prot.h syntax.h ${GRAM_H} \
+ quit.h unwind_prot.h syntax.h \
command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \
subst.h externs.h siglist.h bashhist.h bashline.h bashtypes.h \
array.h arrayfunc.h sig.h mailcheck.h bashintl.h bashjmp.h \
ARRAY_O = @ARRAY_O@
# Matching object files.
-OBJECTS = shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
+OBJECTS = shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o \
dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o \
expr.o flags.o $(JOBS_O) subst.o hashcmd.o hashlib.o mailcheck.o \
trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \
DEFSRC=$(BUILTIN_SRCDIR)
BUILTIN_ABSSRC=${topdir}/builtins
DEFDIR = $(dot)/builtins
-DEBUGGER_DIR = $(dot)/debugger
BUILTIN_DEFS = $(DEFSRC)/alias.def $(DEFSRC)/bind.def $(DEFSRC)/break.def \
$(DEFSRC)/builtin.def $(DEFSRC)/cd.def $(DEFSRC)/colon.def \
PO_SRC = $(srcdir)/po/
PO_DIR = $(dot)/po/
-SIGNAMES_SUPPORT = $(SUPPORT_SRC)mksignames.c
-
+# Auxiliary support files
SUPPORT_SRC = $(srcdir)/support/
-SDIR = $(dot)/support
+SUPPORT_DIR = $(dot)/support
TESTS_SUPPORT = recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) xcase$(EXEEXT)
CREATED_SUPPORT = signames.h recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) \
# Keep GNU Make from exporting the entire environment for small machines.
.NOEXPORT:
-.made: $(Program) bashbug $(SDIR)/man2html$(EXEEXT)
+.made: $(Program) bashbug $(SUPPORT_DIR)/man2html$(EXEEXT)
@echo "$(Program) last made for a $(Machine) running $(OS)" >.made
$(Program): $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) .build
$(RM) $@
- $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
+ $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
ls -l $(Program)
-$(SIZE) $(Program)
@echo " ***********************************************************"
@echo
-bashbug: $(SDIR)/bashbug.sh $(VERSPROG)
+bashbug: $(SUPPORT_DIR)/bashbug.sh $(VERSPROG)
@sed -e "s%!PATCHLEVEL!%$(PatchLevel)%" \
- $(SDIR)/bashbug.sh > $@
+ $(SUPPORT_DIR)/bashbug.sh > $@
@chmod a+rx bashbug
strip: $(Program) .made
gcov:
${MAKE} $(BASH_MAKEFLAGS) CFLAGS=-g ADDON_CFLAGS='${GCOV_XCFLAGS}' ADDON_LDFLAGS='${GCOV_XLDFLAGS}' .made
-
# have to make this separate because making tests depend on $(PROGRAM)
asan-tests: asan $(TESTS_SUPPORT)
@-test -d tests || mkdir tests
@( cd $(srcdir)/tests && \
BUILD_DIR=$(BUILD_DIR) PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
-profiling-tests: ${PROGRAM}
+profiling-tests: ${Program}
@test "X$$PROFILE_FLAGS" == "X" && { echo "profiling-tests: must be built with profiling enabled" >&2; exit 1; }
@${MAKE} $(BASH_MAKEFLAGS) tests TESTSCRIPT=run-gprof
$(RM) $@
./mksyntax$(EXEEXT) -o $@
-$(BUILTINS_LIBRARY): $(DEFDIR)/builtext.h $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h version.h
+$(BUILTINS_LIBRARY): $(DEFDIR)/builtext.h $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h
@(cd $(DEFDIR) && $(MAKE) $(BASH_MAKEFLAGS) DEBUG=${DEBUG} targets ) || exit 1
# these require special rules to circumvent make builtin rules
${DEFDIR}/pipesize.h: ${BUILTINS_LIBRARY}
@(cd $(DEFDIR) && $(MAKE) $(BASH_MAKEFLAGS) pipesize.h ) || exit 1
-$(SDIR)/man2html$(EXEEXT): ${SUPPORT_SRC}/man2html.c
- @(cd $(SDIR) && $(MAKE) $(BASH_MAKEFLAGS) all ) || exit 1
+$(SUPPORT_DIR)/man2html$(EXEEXT): $(SUPPORT_SRC)man2html.c
+ @(cd $(SUPPORT_DIR) && $(MAKE) $(BASH_MAKEFLAGS) all ) || exit 1
# For the justification of the following Makefile rules, see node
# `Automatic Remaking' in GNU Autoconf documentation.
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
+$(SUPPORT_DIR)/bashbug.sh: $(SUPPORT_DIR)/bashbug.sh.in
+ CONFIG_FILES=$(SUPPORT_DIR)/bashbug.sh CONFIG_HEADERS= $(SHELL) ./config.status
# comment out for distribution
$(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in
force:
# unused
-TAGS: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
- ( cd $(topdir) && $(ETAGS) $(ETAGSFLAGS) $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) )
+TAGS: $(SOURCES) $(BUILTIN_C_SRC)
+ ( cd $(topdir) && $(ETAGS) $(ETAGSFLAGS) $(SOURCES) $(BUILTIN_C_SRC) )
-tags: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
- ( cd $(topdir) && $(CTAGS) $(CTAGSFLAGS) $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) > $@ )
+tags: $(SOURCES) $(BUILTIN_C_SRC)
+ ( cd $(topdir) && $(CTAGS) $(CTAGSFLAGS) $(SOURCES) $(BUILTIN_C_SRC) )
# Targets that actually do things not part of the build
${INSTALL_DATA} $(srcdir)/"$$hf" $(DESTDIR)$(headersdir)/$$hf || exit 1; \
fi ; \
done
- -$(INSTALL_DATA) $(SDIR)/bash.pc $(DESTDIR)$(pkgconfigdir)/bash.pc
+ -$(INSTALL_DATA) $(SUPPORT_DIR)/bash.pc $(DESTDIR)$(pkgconfigdir)/bash.pc
uninstall-headers:
-( cd $(DESTDIR)$(headersdir) && $(RM) $(INSTALLED_HEADERS) )
clean: basic-clean
( cd $(DOCDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
( cd builtins && $(MAKE) $(BASH_MAKEFLAGS) $@ )
- -( cd $(SDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
+ -( cd $(SUPPORT_DIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(BASH_MAKEFLAGS) $@) ;\
done
mostlyclean: basic-clean
( cd $(DOCDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
( cd builtins && $(MAKE) $(BASH_MAKEFLAGS) $@ )
- -( cd $(SDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
+ -( cd $(SUPPORT_DIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(BASH_MAKEFLAGS) $@) ;\
done
distclean: basic-clean maybe-clean
( cd $(DOCDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
( cd builtins && $(MAKE) $(BASH_MAKEFLAGS) $@ )
- -( cd $(SDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
+ -( cd $(SUPPORT_DIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(BASH_MAKEFLAGS) $@) ;\
done
$(RM) y.tab.c y.tab.h parser-built tags TAGS
( cd $(DOCDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
( cd builtins && $(MAKE) $(BASH_MAKEFLAGS) $@ )
- ( cd $(SDIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
+ ( cd $(SUPPORT_DIR) && $(MAKE) $(BASH_MAKEFLAGS) $@ )
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(BASH_MAKEFLAGS) $@) ;\
done
variables.o: findcmd.h bashhist.h hashcmd.h pathexp.h
variables.o: pcomplete.h ${BASHINCDIR}/chartypes.h
variables.o: ${BASHINCDIR}/posixtime.h assoc.h ${DEFSRC}/getopt.h
-variables.o: version.h $(DEFDIR)/builtext.h
+variables.o: $(DEFDIR)/builtext.h
version.o: conftypes.h patchlevel.h version.h
version.o: buildconf.h
xmalloc.o: config.h bashtypes.h ${BASHINCDIR}/ansi_stdlib.h error.h
AC_DEFUN(BASH_STRUCT_DIRENT,
[
AC_REQUIRE([AC_HEADER_DIRENT])
-AC_CHECK_MEMBERS(struct dirent.$1, bash_cv_dirent_has_$1=yes, bash_cv_dirent_has_$1=no,
+AC_CHECK_MEMBERS(struct dirent.$1, [], [],
[[
#include <stdio.h>
#include <sys/types.h>
]])
])
-AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
-[AC_REQUIRE([AC_HEADER_DIRENT])
-AC_MSG_CHECKING(for struct dirent.d_ino)
-AC_CACHE_VAL(bash_cv_dirent_has_d_ino, [BASH_STRUCT_DIRENT([d_ino])])
-AC_MSG_RESULT($bash_cv_dirent_has_d_ino)
-if test $bash_cv_dirent_has_d_ino = yes; then
-AC_DEFINE(HAVE_STRUCT_DIRENT_D_INO)
-fi
-])
-
-AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO,
-[AC_REQUIRE([AC_HEADER_DIRENT])
-AC_MSG_CHECKING(for struct dirent.d_fileno)
-AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, [BASH_STRUCT_DIRENT([d_fileno])])
-AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
-if test $bash_cv_dirent_has_d_fileno = yes; then
-AC_DEFINE(HAVE_STRUCT_DIRENT_D_FILENO)
-fi
-])
-
-AC_DEFUN(BASH_STRUCT_DIRENT_D_NAMLEN,
-[AC_REQUIRE([AC_HEADER_DIRENT])
-AC_MSG_CHECKING(for struct dirent.d_namlen)
-AC_CACHE_VAL(bash_cv_dirent_has_d_namlen, [BASH_STRUCT_DIRENT([d_namlen])])
-AC_MSG_RESULT($bash_cv_dirent_has_d_namlen)
-if test $bash_cv_dirent_has_d_namlen = yes; then
-AC_DEFINE(HAVE_STRUCT_DIRENT_D_NAMLEN)
-fi
-])
+AC_DEFUN([BASH_STRUCT_DIRENT_D_INO], [BASH_STRUCT_DIRENT([d_ino])])
+AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO], [BASH_STRUCT_DIRENT([d_fileno])])
+AC_DEFUN([BASH_STRUCT_DIRENT_D_NAMLEN], [BASH_STRUCT_DIRENT([d_namlen])])
AC_DEFUN(BASH_STRUCT_TIMEVAL,
[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
LIBBUILD = ${BUILD_DIR}/lib
+DEBUG = @DEBUG@
+
PROFILE_FLAGS = @PROFILE_FLAGS@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ @CROSS_COMPILE@
INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$(srcdir) ${INTL_INC}
-BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \
+BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) \
${INCLUDES} $(STYLE_CFLAGS) $(LOCAL_CFLAGS)
+ADDON_CFLAGS=
CCFLAGS = ${ADDON_CFLAGS} $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS)
CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
$(OFILES): $(MKBUILTINS) ../config.h
-../version.h: ../config.h ../Makefile Makefile
- -( cd ${BUILD_DIR} && ${MAKE} ${BASH_MAKEFLAGS} version.h )
+# sketchy rule here
+#../version.h: ../config.h ../Makefile Makefile
+# -( cd ${BUILD_DIR} && ${MAKE} ${BASH_MAKEFLAGS} version.h )
# maintainer special - for now
po: builtins.c
return value. */
if (this_shell_builtin == return_builtin && running_trap > 0 && running_trap != DEBUG_TRAP+1 && trap_return_context == funcnest + sourcenest)
return (trap_saved_exit_value);
+ /* The same interp applies to the exit builtin. */
+ if (this_shell_builtin == exit_builtin && running_trap > 0 && running_trap != DEBUG_TRAP+1 && trap_return_context == funcnest + sourcenest)
+ return (trap_saved_exit_value);
return (last_command_exit_value);
}
This file is exit.def, from which is created exit.c.
It implements the builtins "exit", and "logout" in Bash.
-Copyright (C) 1987-2023 Free Software Foundation, Inc.
+Copyright (C) 1987-2024 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
/* If we're running the exit trap (running_trap == 1, since running_trap
gets set to SIG+1), and we don't have a argument given to `exit'
(list == 0), use the exit status we saved before running the trap
- commands (trap_saved_exit_value). */
+ commands (trap_saved_exit_value). get_exitstat() handles the case of
+ running exit from any other trap action (POSIX interp 1602). */
exit_value = (running_trap == 1 && list == 0) ? trap_saved_exit_value : get_exitstat (list);
if (exit_value > EX_SHERRBASE) /* some kind of error */
return (exit_value);
#include <stdio.h>
-#include "version.h"
-
#include "../bashintl.h"
#include "../shell.h"
shell_compatibility_level = 43;
else if (shopt_compat44)
shell_compatibility_level = 44;
- else if (oldval > 44 && shell_compatibility_level < DEFAULT_COMPAT_LEVEL)
+ else if (oldval > 44 && shell_compatibility_level < default_compatibility_level)
;
else
- shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
+ shell_compatibility_level = default_compatibility_level;
/* Make sure the current compatibility level is reflected in BASH_COMPAT */
rhs = itos (shell_compatibility_level);
shopt_compat31 = shopt_compat32 = 0;
shopt_compat40 = shopt_compat41 = shopt_compat42 = shopt_compat43 = 0;
shopt_compat44 = 0;
+ if (shell_compatibility_level == default_compatibility_level)
+ return;
+
switch (shell_compatibility_level)
{
- case DEFAULT_COMPAT_LEVEL:
+ case 52: /* completeness */
case 51: /* completeness */
case 50:
break;
#! /bin/sh
-# From configure.ac for Bash 5.3, version 5.071.
+# From configure.ac for Bash 5.3, version 5.073.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for bash 5.3-beta.
#
RL_VERSION
LIBS_FOR_BUILD
STYLE_CFLAGS
-BASE_CFLAGS_FOR_BUILD
STATIC_LD
SIGNAMES_O
SIGNAMES_H
# CFLAGS set above to default value if not passed in environment
if test -n "$want_auto_cflags" ; then
CFLAGS_FOR_BUILD="${CFLAGS}"
- BASE_CFLAGS_FOR_BUILD="${CFLAGS}"
else
# passed in environment
CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'}
- BASE_CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'}
fi
LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'}
else
CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD="-g"}
- BASE_CFLAGS_FOR_BUILD=${BASE_CFLAGS_FOR_BUILD="-g"}
LIBS_FOR_BUILD=${LIBS_FOR_BUILD-""}
fi
-
if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no"
then
# If the user specified --with-installed-readline=PREFIX and PREFIX
LIBS=$save_LIBS
test $gl_pthread_api = yes && break
done
- echo "$as_me:9229: gl_pthread_api=$gl_pthread_api" >&5
- echo "$as_me:9230: LIBPTHREAD=$LIBPTHREAD" >&5
+ echo "$as_me:9224: gl_pthread_api=$gl_pthread_api" >&5
+ echo "$as_me:9225: LIBPTHREAD=$LIBPTHREAD" >&5
gl_pthread_in_glibc=no
# On Linux with glibc >= 2.34, libc contains the fully functional
;;
esac
- echo "$as_me:9256: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+ echo "$as_me:9251: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
# Test for libpthread by looking for pthread_kill. (Not pthread_self,
# since it is defined as a macro on OSF/1.)
fi
fi
- echo "$as_me:9434: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+ echo "$as_me:9429: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
printf %s "checking whether POSIX threads API is available... " >&6; }
LIBS=$save_LIBS
test $gl_pthread_api = yes && break
done
- echo "$as_me:9681: gl_pthread_api=$gl_pthread_api" >&5
- echo "$as_me:9682: LIBPTHREAD=$LIBPTHREAD" >&5
+ echo "$as_me:9676: gl_pthread_api=$gl_pthread_api" >&5
+ echo "$as_me:9677: LIBPTHREAD=$LIBPTHREAD" >&5
gl_pthread_in_glibc=no
# On Linux with glibc >= 2.34, libc contains the fully functional
;;
esac
- echo "$as_me:9708: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+ echo "$as_me:9703: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
# Test for libpthread by looking for pthread_kill. (Not pthread_self,
# since it is defined as a macro on OSF/1.)
fi
fi
- echo "$as_me:9886: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+ echo "$as_me:9881: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
printf %s "checking whether POSIX threads API is available... " >&6; }
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_ino" >&5
-printf %s "checking for struct dirent.d_ino... " >&6; }
-if test ${bash_cv_dirent_has_d_ino+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
ac_fn_c_check_member "$LINENO" "struct dirent" "d_ino" "ac_cv_member_struct_dirent_d_ino" "
#include <stdio.h>
printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h
-bash_cv_dirent_has_d_ino=yes
-else case e in #(
- e) bash_cv_dirent_has_d_ino=no ;;
-esac
-fi
- ;;
-esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_ino" >&5
-printf "%s\n" "$bash_cv_dirent_has_d_ino" >&6; }
-if test $bash_cv_dirent_has_d_ino = yes; then
-printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h
-
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_fileno" >&5
-printf %s "checking for struct dirent.d_fileno... " >&6; }
-if test ${bash_cv_dirent_has_d_fileno+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
ac_fn_c_check_member "$LINENO" "struct dirent" "d_fileno" "ac_cv_member_struct_dirent_d_fileno" "
#include <stdio.h>
printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_FILENO 1" >>confdefs.h
-bash_cv_dirent_has_d_fileno=yes
-else case e in #(
- e) bash_cv_dirent_has_d_fileno=no ;;
-esac
-fi
- ;;
-esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_fileno" >&5
-printf "%s\n" "$bash_cv_dirent_has_d_fileno" >&6; }
-if test $bash_cv_dirent_has_d_fileno = yes; then
-printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_FILENO 1" >>confdefs.h
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_namlen" >&5
-printf %s "checking for struct dirent.d_namlen... " >&6; }
-if test ${bash_cv_dirent_has_d_namlen+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
-
ac_fn_c_check_member "$LINENO" "struct dirent" "d_namlen" "ac_cv_member_struct_dirent_d_namlen" "
#include <stdio.h>
#include <sys/types.h>
printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" >>confdefs.h
-bash_cv_dirent_has_d_namlen=yes
-else case e in #(
- e) bash_cv_dirent_has_d_namlen=no ;;
-esac
-fi
- ;;
-esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_namlen" >&5
-printf "%s\n" "$bash_cv_dirent_has_d_namlen" >&6; }
-if test $bash_cv_dirent_has_d_namlen = yes; then
-printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" >>confdefs.h
-
-fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct winsize in sys/ioctl.h and termios.h" >&5
printf %s "checking for struct winsize in sys/ioctl.h and termios.h... " >&6; }
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for usable strtoimax" >&5
-printf %s "checking for usable strtoimax... " >&6; }
-if test ${bash_cv_func_strtoimax+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- HAVE_STRTOIMAX=0 HAVE_DECL_STRTOIMAX=0
-
ac_fn_c_check_func "$LINENO" "strtoimax" "ac_cv_func_strtoimax"
if test "x$ac_cv_func_strtoimax" = xyes
then :
printf "%s\n" "#define HAVE_DECL_STRTOIMAX $ac_have_decl" >>confdefs.h
- if test "$ac_cv_func_strtoimax" = "yes" ; then
- HAVE_STRTOIMAX=1
- fi
- if test "$ac_cv_have_decl_strtoimax" = "yes" ; then
- HAVE_DECL_STRTOIMAX=1
- fi
- if test "$HAVE_STRTOIMAX" = 0 || test "$HAVE_DECL_STRTOIMAX" = 0 ; then
- bash_cv_func_strtoimax=no REPLACE_STRTOIMAX=1
- else
- bash_cv_func_strtoimax=yes
- fi
- ;;
-esac
-fi
-
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strtoimax" >&5
-printf "%s\n" "$bash_cv_func_strtoimax" >&6; }
-if test "$ac_cv_have_decl_strtoimax" = "yes" ; then
-printf "%s\n" "#define HAVE_DECL_STRTOIMAX 1" >>confdefs.h
-
-fi
-if test $bash_cv_func_strtoimax = no; then
-case " $LIBOBJS " in
+ if test "$ac_cv_func_strtoimax" != "yes" ; then
+ case " $LIBOBJS " in
*" strtoimax.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS strtoimax.$ac_objext"
;;
esac
-fi
+ fi
ac_fn_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes
# 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.071])dnl
+AC_REVISION([for Bash 5.3, version 5.073])dnl
define(bashvers, 5.3)
define(relstatus, beta)
# CFLAGS set above to default value if not passed in environment
if test -n "$want_auto_cflags" ; then
CFLAGS_FOR_BUILD="${CFLAGS}"
- BASE_CFLAGS_FOR_BUILD="${CFLAGS}"
else
# passed in environment
CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'}
- BASE_CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'}
fi
LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'}
else
CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD="-g"}
- BASE_CFLAGS_FOR_BUILD=${BASE_CFLAGS_FOR_BUILD="-g"}
LIBS_FOR_BUILD=${LIBS_FOR_BUILD-""}
fi
AC_SUBST(CC_FOR_BUILD)
AC_SUBST(CFLAGS_FOR_BUILD)
-AC_SUBST(BASE_CFLAGS_FOR_BUILD)
AC_SUBST(STYLE_CFLAGS)
AC_SUBST(CPPFLAGS_FOR_BUILD)
AC_SUBST(LDFLAGS_FOR_BUILD)
# bad style
RL_LIBDIR = $(topdir)/lib/readline
-# unused
-TEXINDEX = texindex
-TEX = tex
-
MAKEINFO = makeinfo
TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi
TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html
SHELL = @MAKE_SHELL@
PROFILE_FLAGS = @PROFILE_FLAGS@
+ADDON_CFLAGS =
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
ALLOCA_OBJECT = alloca.o
MALLOC_SRC = @MALLOC_SRC@
-MALLOC = @MALLOC@
ALLOCA = @ALLOCA@
MALLOC_OBJS = malloc.o $(ALLOCA) trace.o stats.o table.o watch.o
DEBUG = @DEBUG@
+ADDON_CFLAGS =
+
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
STYLE_CFLAGS = @STYLE_CFLAGS@
SHELL = @MAKE_SHELL@
+DEBUG = @DEBUG@
+
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
STYLE_CFLAGS = @STYLE_CFLAGS@
PROFILE_FLAGS = @PROFILE_FLAGS@
+ADDON_CFLAGS =
+
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
HSOURCES =
# The object files contained in $(LIBRARY_NAME)
+LIBOBJDIR =
LIBOBJS = @LIBOBJS@
OBJECTS = clktck.o clock.o getenv.o oslib.o setlinebuf.o strnlen.o \
itos.o zread.o zwrite.o shtty.o shmatch.o eaccess.o \
PROFILE_FLAGS = @PROFILE_FLAGS@
+ADDON_CFLAGS =
+
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
STYLE_CFLAGS = @STYLE_CFLAGS@
INCLUDES = -I. -I../.. -I$(topdir) -I${BASHINCDIR} -I$(topdir)/lib
-CCFLAGS = ${ASAN_CFLAGS} $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \
- ${INCLUDES} $(STYLE_CFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
+CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \
+ ${INCLUDES} $(STYLE_CFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) \
+ ${ADDON_CFLAGS}
.c.o:
$(CC) -c $(CCFLAGS) $<
dnl Make sure we replace strtoimax if we don't have a declaration
dnl We can use this as a template for future function checks
-AC_DEFUN([BASH_FUNC_STRTOIMAX], [
-AC_MSG_CHECKING([for usable strtoimax])
-AC_CACHE_VAL(bash_cv_func_strtoimax,
+AC_DEFUN([BASH_FUNC_STRTOIMAX],
[
- HAVE_STRTOIMAX=0 HAVE_DECL_STRTOIMAX=0
-
AC_CHECK_FUNCS([strtoimax])
AC_CHECK_DECLS([strtoimax])
- if test "$ac_cv_func_strtoimax" = "yes" ; then
- HAVE_STRTOIMAX=1
- fi
- if test "$ac_cv_have_decl_strtoimax" = "yes" ; then
- HAVE_DECL_STRTOIMAX=1
+ if test "$ac_cv_func_strtoimax" != "yes" ; then
+ AC_LIBOBJ(strtoimax)
fi
- if test "$HAVE_STRTOIMAX" = 0 || test "$HAVE_DECL_STRTOIMAX" = 0 ; then
- bash_cv_func_strtoimax=no REPLACE_STRTOIMAX=1
- else
- bash_cv_func_strtoimax=yes
- fi
-])
-AC_MSG_RESULT($bash_cv_func_strtoimax)
-if test "$ac_cv_have_decl_strtoimax" = "yes" ; then
-AC_DEFINE([HAVE_DECL_STRTOIMAX], [1])
-fi
-if test $bash_cv_func_strtoimax = no; then
-AC_LIBOBJ(strtoimax)
-fi
])
/* The token read prior to token_before_that. */
static int two_tokens_ago;
-/* Someday compoundcmd_lineno will be an array of these structs. */
+/* compoundcmd_lineno is an array of these structs. This holds information
+ about the current compound command the parser is reading (token) and
+ where it begins (lineno). */
struct tokeninfo {
int lineno;
- int tok;
+ int token;
};
/* The line number in a script where a compound command begins. The
This is a nested command maximum, since the array index is decremented
after a compound command is parsed. */
#define MAX_COMPOUND_NEST 256
-static int compoundcmd_lineno[MAX_COMPOUND_NEST+1];
+static struct tokeninfo compoundcmd_lineno[MAX_COMPOUND_NEST+1];
static int compoundcmd_top = -1;
/* If non-zero, it is the token that we want read_token to return
for_command: FOR WORD newline_list DO compound_list DONE
{
- $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| FOR WORD newline_list '{' compound_list '}'
{
- $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* FOR */
}
| FOR WORD ';' newline_list DO compound_list DONE
{
- $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| FOR WORD ';' newline_list '{' compound_list '}'
{
- $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* FOR */
}
| FOR WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE
{
- $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}'
{
- $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* FOR */
}
| FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE
{
- $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}'
{
- $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* FOR */
}
select_command: SELECT WORD newline_list DO compound_list DONE
{
- $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| SELECT WORD newline_list '{' compound_list '}'
{
- $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* SELECT */
}
| SELECT WORD ';' newline_list DO compound_list DONE
{
- $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| SELECT WORD ';' newline_list '{' compound_list '}'
{
- $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* SELECT */
}
| SELECT WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE
{
- $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| SELECT WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}'
{
- $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* SELECT */
}
| SELECT WORD newline_list IN list_terminator newline_list DO compound_list DONE
{
- $$ = make_select_command ($2, (WORD_LIST *)NULL, $8, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_select_command ($2, (WORD_LIST *)NULL, $8, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| SELECT WORD newline_list IN list_terminator newline_list '{' compound_list '}'
{
- $$ = make_select_command ($2, (WORD_LIST *)NULL, $8, compoundcmd_lineno[compoundcmd_top]);
+ int l;
+ l = (compoundcmd_top > 0) ? compoundcmd_lineno[compoundcmd_top - 1].lineno
+ : compoundcmd_lineno[compoundcmd_top].lineno;
+ $$ = make_select_command ($2, (WORD_LIST *)NULL, $8, l);
if (compoundcmd_top >= 0) compoundcmd_top--; /* RBRACE */
if (compoundcmd_top >= 0) compoundcmd_top--; /* SELECT */
}
case_command: CASE WORD newline_list IN newline_list ESAC
{
- $$ = make_case_command ($2, (PATTERN_LIST *)NULL, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_case_command ($2, (PATTERN_LIST *)NULL, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| CASE WORD newline_list IN case_clause_sequence newline_list ESAC
{
- $$ = make_case_command ($2, $5, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_case_command ($2, $5, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
| CASE WORD newline_list IN case_clause ESAC
{
- $$ = make_case_command ($2, $5, compoundcmd_lineno[compoundcmd_top]);
+ $$ = make_case_command ($2, $5, compoundcmd_lineno[compoundcmd_top].lineno);
if (compoundcmd_top >= 0) compoundcmd_top--;
}
;
#if defined (ARITH_FOR_COMMAND)
if (last_read_token == FOR)
{
- arith_for_lineno = compoundcmd_top[compoundcmd_lineno];
+ arith_for_lineno = compoundcmd_top[compoundcmd_lineno].lineno;
cmdtyp = parse_arith_cmd (&wval, 0);
if (cmdtyp == 1)
{
case COND_START:
if (compoundcmd_top < MAX_COMPOUND_NEST)
compoundcmd_top++;
- compoundcmd_lineno[compoundcmd_top] = line_number;
+ compoundcmd_lineno[compoundcmd_top].lineno = line_number;
+ compoundcmd_lineno[compoundcmd_top].token = t;
break;
default:
break;
free (msg);
msg = p;
}
-if (shell_eof_token && current_token != shell_eof_token)
- parser_error (line_number, _("syntax error near unexpected token `%s' while looking for matching `%c'"), msg, shell_eof_token);
-else
- parser_error (line_number, _("syntax error near unexpected token `%s'"), msg);
+ if (shell_eof_token && current_token != shell_eof_token)
+ parser_error (line_number, _("syntax error near unexpected token `%s' while looking for matching `%c'"), msg, shell_eof_token);
+ else
+ parser_error (line_number, _("syntax error near unexpected token `%s'"), msg);
free (msg);
if (interactive == 0)
if (EOF_Reached && shell_eof_token && current_token != shell_eof_token)
parser_error (line_number, _("unexpected EOF while looking for matching `%c'"), shell_eof_token);
else if (EOF_Reached && compoundcmd_top >= 0)
- parser_error (line_number, _("syntax error: unexpected end of file from command on line %d"), compoundcmd_lineno[compoundcmd_top]);
+ {
+ char *x;
+ x = find_token_in_alist (compoundcmd_lineno[compoundcmd_top].token, word_token_alist, 1);
+ if (x == 0)
+ x = find_token_in_alist (compoundcmd_lineno[compoundcmd_top].token, other_token_alist, 1);
+ if (x)
+ parser_error (line_number, _("syntax error: unexpected end of file from `%s' command on line %d"), x, compoundcmd_lineno[compoundcmd_top].lineno);
+ else
+ parser_error (line_number, _("syntax error: unexpected end of file from command on line %d"), compoundcmd_lineno[compoundcmd_top].lineno);
+ }
else
{
msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error");
extern int current_command_number;
extern int indirection_level;
extern int shell_compatibility_level;
+extern const int default_compatibility_level;
extern int running_under_emacs;
extern int pretty_print_mode;
/* Find TOKEN in ALIST, a list of string/int value pairs. Return the
corresponding string. Allocates memory for the returned
- string. FLAGS is currently ignored, but reserved. */
+ string. FLAGS == 0 means to allocate new memory, the existing
+ behavior. If FLAGS&1, we just return the token and expect the caller
+ to allocate new memory and save it, if necessary. */
char *
find_token_in_alist (int token, STRING_INT_ALIST *alist, int flags)
{
for (i = 0; alist[i].word; i++)
{
if (alist[i].token == token)
- return (savestring (alist[i].word));
+ return (flags ? alist[i].word : savestring (alist[i].word));
}
return (NULL);
}
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
-BASE_CFLAGS_FOR_BUILD = @BASE_CFLAGS_FOR_BUILD@
CPPFLAGS = @CPPFLAGS@
CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
INCLUDES = -I${BUILD_DIR} -I${topdir}
-BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \
+BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) \
${INCLUDES} $(STYLE_CFLAGS) $(LOCAL_CFLAGS)
CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS)
ok 7
ok 8
bash: -c: line 1: unexpected token `EOF', expected `)'
-bash: -c: line 2: syntax error: unexpected end of file from command on line 1
+bash: -c: line 2: syntax error: unexpected end of file from `[[' command on line 1
bash: -c: line 1: unexpected EOF while looking for `]]'
-bash: -c: line 2: syntax error: unexpected end of file from command on line 1
+bash: -c: line 2: syntax error: unexpected end of file from `[[' command on line 1
bash: -c: line 1: syntax error in conditional expression: unexpected token `]'
bash: -c: line 1: syntax error near `]'
bash: -c: line 1: `[[ ( -t X ) ]'
./errors7.sub: line 27: x: readonly variable
./errors7.sub: line 29: x: readonly variable
./errors7.sub: line 32: v: readonly variable
-./errors8.sub: eval: line 7: syntax error: unexpected end of file from command on line 6
+./errors8.sub: eval: line 7: syntax error: unexpected end of file from `(' command on line 6
ok 1
./errors8.sub: line 8: v: readonly variable
ok 2
array: 1
sh: line 1: export: `AA[4]': not a valid identifier
sh: line 1: readonly: `AA[4]': not a valid identifier
-bash: -c: line 5: syntax error: unexpected end of file from command on line 1
-bash: -c: line 3: syntax error: unexpected end of file from command on line 1
-bash: -c: line 4: syntax error: unexpected end of file from command on line 1
-bash: -c: line 5: syntax error: unexpected end of file from command on line 1
-bash: -c: line 7: syntax error: unexpected end of file from command on line 1
+bash: -c: line 5: syntax error: unexpected end of file from `if' command on line 1
+bash: -c: line 3: syntax error: unexpected end of file from `while' command on line 1
+bash: -c: line 4: syntax error: unexpected end of file from `until' command on line 1
+bash: -c: line 5: syntax error: unexpected end of file from `for' command on line 1
+bash: -c: line 7: syntax error: unexpected end of file from `case' command on line 1
bash: line 1: return: can only `return' from a function or sourced script
after return
bash: line 1: return: can only `return' from a function or sourced script
exportfunc ok 1
exportfunc ok 2
./exportfunc.tests: line 37: cve7169-bad: No such file or directory
-./exportfunc.tests: eval: line 44: syntax error: unexpected end of file from command on line 42
+./exportfunc.tests: eval: line 44: syntax error: unexpected end of file from `{' command on line 42
./exportfunc.tests: line 43: cve7169-bad2: No such file or directory
./exportfunc1.sub: line 14: maximum here-document count exceeded
./exportfunc.tests: line 72: HELLO_WORLD: No such file or directory
\END
end hello<NL>\END
./heredoc3.sub: line 98: warning: here-document at line 96 delimited by end-of-file (wanted `EOF')
-./heredoc3.sub: line 99: syntax error: unexpected end of file from command on line 96
+./heredoc3.sub: line 99: syntax error: unexpected end of file from `(' command on line 96
heredoc1
EOF
Ok:0
v = find_variable (name);
if (v == 0)
{
- shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
+ shell_compatibility_level = default_compatibility_level;
set_compatibility_opts ();
return;
}
val = value_cell (v);
if (val == 0 || *val == '\0')
{
- shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
+ shell_compatibility_level = default_compatibility_level;
set_compatibility_opts ();
return;
}
return;
}
- if (compatval < MIN_COMPAT_LEVEL || compatval > DEFAULT_COMPAT_LEVEL)
+ if (compatval < MIN_COMPAT_LEVEL || compatval > default_compatibility_level)
goto compat_error;
shell_compatibility_level = compatval;
const char * const bash_license = N_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
/* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */
+const int default_compatibility_level = DEFAULT_COMPAT_LEVEL;
int shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
/* Functions for getting, setting, and displaying the shell version. */