Compare commits
No commits in common. 'i10cs' and 'c9' have entirely different histories.
@ -1,2 +1 @@
|
|||||||
a799460be16c01aeab492b9aa88f5eb7f35c1b9b SOURCES/bash-5.2.tar.gz
|
063019501ef1f30fad99d2b735a7ae2ce1d11423 SOURCES/bash-5.1.tar.gz
|
||||||
993ce9aa151dd3b3cb7b2f8eb6ff05f548cbba7f SOURCES/bash-5.2.tar.gz.sig
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
SOURCES/bash-5.2.tar.gz
|
SOURCES/bash-5.1.tar.gz
|
||||||
SOURCES/bash-5.2.tar.gz.sig
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
--- bash-3.0/config-top.h.paths 2003-08-05 15:36:12.000000000 +0100
|
||||||
|
+++ bash-3.0/config-top.h 2004-07-28 09:36:27.117205637 +0100
|
||||||
|
@@ -66,7 +66,7 @@
|
||||||
|
the Posix.2 confstr () function, or CS_PATH define are not present. */
|
||||||
|
#ifndef STANDARD_UTILS_PATH
|
||||||
|
#define STANDARD_UTILS_PATH \
|
||||||
|
- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
|
||||||
|
+ "/bin:/usr/bin:/usr/sbin:/sbin"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Default primary and secondary prompt strings. */
|
@ -1,12 +1,11 @@
|
|||||||
diff --git a/aclocal.m4 b/aclocal.m4
|
--- bash-2.05b/aclocal.m4.pgrp_sync 2002-06-25 14:45:43.000000000 +0100
|
||||||
--- a/aclocal.m4
|
+++ bash-2.05b/aclocal.m4 2003-01-15 18:17:35.000000000 +0000
|
||||||
+++ b/aclocal.m4
|
@@ -1255,7 +1255,7 @@
|
||||||
@@ -1324,7 +1324,7 @@ main()
|
|
||||||
wait(&status);
|
wait(&status);
|
||||||
exit(ok ? 0 : 5);
|
exit(ok ? 0 : 5);
|
||||||
}
|
}
|
||||||
-]])], [bash_cv_pgrp_pipe=no], [bash_cv_pgrp_pipe=yes],
|
-], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
|
||||||
+]])], [bash_cv_pgrp_pipe=yes], [bash_cv_pgrp_pipe=yes],
|
+], bash_cv_pgrp_pipe=yes,bash_cv_pgrp_pipe=yes,
|
||||||
[AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
|
[AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
|
||||||
bash_cv_pgrp_pipe=no]
|
bash_cv_pgrp_pipe=no])
|
||||||
)])
|
])
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/subst.c b/subst.c
|
||||||
|
--- a/subst.c
|
||||||
|
+++ b/subst.c
|
||||||
|
@@ -6240,7 +6240,7 @@ read_comsub (fd, quoted, flags, rflag)
|
||||||
|
/* read a multibyte character from buf */
|
||||||
|
/* punt on the hard case for now */
|
||||||
|
memset (&ps, '\0', sizeof (mbstate_t));
|
||||||
|
- mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps);
|
||||||
|
+ mblen = mbrtowc (&wc, bufp-1, bufn, &ps);
|
||||||
|
if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
|
||||||
|
istring[istring_index++] = c;
|
||||||
|
else
|
@ -0,0 +1,50 @@
|
|||||||
|
diff --git a/Makefile.in b/Makefile.in
|
||||||
|
--- a/Makefile.in
|
||||||
|
+++ b/Makefile.in
|
||||||
|
@@ -1315,6 +1315,7 @@ bashline.o: trap.h flags.h assoc.h $(BASHINCDIR)/ocache.h
|
||||||
|
bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h
|
||||||
|
bashline.o: pcomplete.h ${BASHINCDIR}/chartypes.h input.h
|
||||||
|
bashline.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h
|
||||||
|
+bashline.o: ${DEFDIR}/builtext.h
|
||||||
|
bracecomp.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
|
||||||
|
bracecomp.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h
|
||||||
|
bracecomp.o: command.h ${BASHINCDIR}/stdc.h error.h
|
||||||
|
@@ -1435,6 +1436,7 @@ builtins/evalstring.o: quit.h unwind_prot.h ${BASHINCDIR}/maxpath.h jobs.h built
|
||||||
|
builtins/evalstring.o: dispose_cmd.h make_cmd.h subst.h externs.h
|
||||||
|
builtins/evalstring.o: jobs.h builtins.h flags.h input.h execute_cmd.h
|
||||||
|
builtins/evalstring.o: bashhist.h $(DEFSRC)/common.h pathnames.h
|
||||||
|
+builtins/evalstring.o: ${DEFDIR}/builtext.h
|
||||||
|
builtins/getopt.o: config.h ${BASHINCDIR}/memalloc.h
|
||||||
|
builtins/getopt.o: shell.h syntax.h bashjmp.h command.h general.h xmalloc.h error.h
|
||||||
|
builtins/getopt.o: variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
|
||||||
|
diff --git a/builtins/Makefile.in b/builtins/Makefile.in
|
||||||
|
--- a/builtins/Makefile.in
|
||||||
|
+++ b/builtins/Makefile.in
|
||||||
|
@@ -361,7 +361,7 @@ evalstring.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||||
|
evalstring.o: $(topdir)/externs.h $(topdir)/jobs.h $(topdir)/builtins.h
|
||||||
|
evalstring.o: $(topdir)/flags.h $(topdir)/input.h $(topdir)/execute_cmd.h
|
||||||
|
evalstring.o: $(topdir)/bashhist.h $(srcdir)/common.h
|
||||||
|
-evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h
|
||||||
|
+evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h ./builtext.h
|
||||||
|
#evalstring.o: $(topdir)/y.tab.h
|
||||||
|
getopt.o: ../config.h $(BASHINCDIR)/memalloc.h
|
||||||
|
getopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(topdir)/command.h
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
/* patchlevel.h -- current bash patch level */
|
||||||
|
|
||||||
|
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
|
||||||
|
+/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of GNU Bash, the Bourne Again SHell.
|
||||||
|
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 0
|
||||||
|
+#define PATCHLEVEL 1
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
@ -0,0 +1,29 @@
|
|||||||
|
diff --git a/builtins/wait.def b/builtins/wait.def
|
||||||
|
--- a/builtins/wait.def
|
||||||
|
+++ b/builtins/wait.def
|
||||||
|
@@ -213,11 +213,11 @@ wait_builtin (list)
|
||||||
|
}
|
||||||
|
|
||||||
|
status = wait_for_any_job (wflags, &pstat);
|
||||||
|
- if (status < 0)
|
||||||
|
- status = 127;
|
||||||
|
-
|
||||||
|
if (vname && status >= 0)
|
||||||
|
bind_var_to_int (vname, pstat.pid);
|
||||||
|
+
|
||||||
|
+ if (status < 0)
|
||||||
|
+ status = 127;
|
||||||
|
if (list)
|
||||||
|
unset_waitlist ();
|
||||||
|
WAIT_RETURN (status);
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 1
|
||||||
|
+#define PATCHLEVEL 2
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
@ -0,0 +1,27 @@
|
|||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 2
|
||||||
|
+#define PATCHLEVEL 3
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
diff --git a/subst.c b/subst.c
|
||||||
|
--- a/subst.c
|
||||||
|
+++ b/subst.c
|
||||||
|
@@ -6356,8 +6356,10 @@ command_substitute (string, quoted, flags)
|
||||||
|
|
||||||
|
#if defined (JOB_CONTROL)
|
||||||
|
old_pipeline_pgrp = pipeline_pgrp;
|
||||||
|
- /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */
|
||||||
|
- if ((subshell_environment & SUBSHELL_PIPE) == 0)
|
||||||
|
+ /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline or
|
||||||
|
+ we've already forked to run a disk command (and are expanding redirections,
|
||||||
|
+ for example). */
|
||||||
|
+ if ((subshell_environment & (SUBSHELL_FORK|SUBSHELL_PIPE)) == 0)
|
||||||
|
pipeline_pgrp = shell_pgrp;
|
||||||
|
cleanup_the_pipeline ();
|
||||||
|
#endif /* JOB_CONTROL */
|
@ -0,0 +1,97 @@
|
|||||||
|
diff --git a/arrayfunc.c b/arrayfunc.c
|
||||||
|
--- a/arrayfunc.c
|
||||||
|
+++ b/arrayfunc.c
|
||||||
|
@@ -597,6 +597,27 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
|
||||||
|
free (aval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+/* Return non-zero if L appears to be a key-value pair associative array
|
||||||
|
+ compound assignment. */
|
||||||
|
+int
|
||||||
|
+kvpair_assignment_p (l)
|
||||||
|
+ WORD_LIST *l;
|
||||||
|
+{
|
||||||
|
+ return (l && (l->word->flags & W_ASSIGNMENT) == 0 && l->word->word[0] != '['); /*]*/
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+char *
|
||||||
|
+expand_and_quote_kvpair_word (w)
|
||||||
|
+ char *w;
|
||||||
|
+{
|
||||||
|
+ char *t, *r;
|
||||||
|
+
|
||||||
|
+ t = w ? expand_assignment_string_to_string (w, 0) : 0;
|
||||||
|
+ r = sh_single_quote (t ? t : "");
|
||||||
|
+ free (t);
|
||||||
|
+ return r;
|
||||||
|
+}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Callers ensure that VAR is not NULL. Associative array assignments have not
|
||||||
|
@@ -640,7 +661,7 @@ assign_compound_array_list (var, nlist, flags)
|
||||||
|
last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0;
|
||||||
|
|
||||||
|
#if ASSOC_KVPAIR_ASSIGNMENT
|
||||||
|
- if (assoc_p (var) && nlist && (nlist->word->flags & W_ASSIGNMENT) == 0 && nlist->word->word[0] != '[') /*]*/
|
||||||
|
+ if (assoc_p (var) && kvpair_assignment_p (nlist))
|
||||||
|
{
|
||||||
|
iflags = flags & ~ASS_APPEND;
|
||||||
|
assign_assoc_from_kvlist (var, nlist, nhash, iflags);
|
||||||
|
diff --git a/arrayfunc.h b/arrayfunc.h
|
||||||
|
--- a/arrayfunc.h
|
||||||
|
+++ b/arrayfunc.h
|
||||||
|
@@ -67,6 +67,9 @@ extern SHELL_VAR *assign_array_var_from_string PARAMS((SHELL_VAR *, char *, int)
|
||||||
|
extern char *expand_and_quote_assoc_word PARAMS((char *, int));
|
||||||
|
extern void quote_compound_array_list PARAMS((WORD_LIST *, int));
|
||||||
|
|
||||||
|
+extern int kvpair_assignment_p PARAMS((WORD_LIST *));
|
||||||
|
+extern char *expand_and_quote_kvpair_word PARAMS((char *));
|
||||||
|
+
|
||||||
|
extern int unbind_array_element PARAMS((SHELL_VAR *, char *, int));
|
||||||
|
extern int skipsubscript PARAMS((const char *, int, int));
|
||||||
|
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 3
|
||||||
|
+#define PATCHLEVEL 4
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
diff --git a/subst.c b/subst.c
|
||||||
|
--- a/subst.c
|
||||||
|
+++ b/subst.c
|
||||||
|
@@ -11604,6 +11604,7 @@ expand_oneword (value, flags)
|
||||||
|
{
|
||||||
|
WORD_LIST *l, *nl;
|
||||||
|
char *t;
|
||||||
|
+ int kvpair;
|
||||||
|
|
||||||
|
if (flags == 0)
|
||||||
|
{
|
||||||
|
@@ -11618,11 +11619,21 @@ expand_oneword (value, flags)
|
||||||
|
{
|
||||||
|
/* Associative array */
|
||||||
|
l = parse_string_to_word_list (value, 1, "array assign");
|
||||||
|
+#if ASSOC_KVPAIR_ASSIGNMENT
|
||||||
|
+ kvpair = kvpair_assignment_p (l);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* For associative arrays, with their arbitrary subscripts, we have to
|
||||||
|
expand and quote in one step so we don't have to search for the
|
||||||
|
closing right bracket more than once. */
|
||||||
|
for (nl = l; nl; nl = nl->next)
|
||||||
|
{
|
||||||
|
+#if ASSOC_KVPAIR_ASSIGNMENT
|
||||||
|
+ if (kvpair)
|
||||||
|
+ /* keys and values undergo the same set of expansions */
|
||||||
|
+ t = expand_and_quote_kvpair_word (nl->word->word);
|
||||||
|
+ else
|
||||||
|
+#endif
|
||||||
|
if ((nl->word->flags & W_ASSIGNMENT) == 0)
|
||||||
|
t = sh_single_quote (nl->word->word ? nl->word->word : "");
|
||||||
|
else
|
@ -0,0 +1,85 @@
|
|||||||
|
From cc978a670597afc3251baca3a7db553f36946c22 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chet Ramey <chet.ramey@case.edu>
|
||||||
|
Date: Tue, 4 May 2021 14:29:06 -0400
|
||||||
|
Subject: [PATCH] Bash-5.1 patch 5: fix memory leaks in compound array
|
||||||
|
assignments
|
||||||
|
|
||||||
|
---
|
||||||
|
arrayfunc.c | 11 +++--------
|
||||||
|
patchlevel.h | 2 +-
|
||||||
|
subst.c | 2 ++
|
||||||
|
3 files changed, 6 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/arrayfunc.c b/arrayfunc.c
|
||||||
|
index 8231ba1e..9338dfc7 100644
|
||||||
|
--- a/arrayfunc.c
|
||||||
|
+++ b/arrayfunc.c
|
||||||
|
@@ -564,12 +564,9 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
|
||||||
|
{
|
||||||
|
WORD_LIST *list;
|
||||||
|
char *akey, *aval, *k, *v;
|
||||||
|
- int free_aval;
|
||||||
|
|
||||||
|
for (list = nlist; list; list = list->next)
|
||||||
|
{
|
||||||
|
- free_aval = 0;
|
||||||
|
-
|
||||||
|
k = list->word->word;
|
||||||
|
v = list->next ? list->next->word->word : 0;
|
||||||
|
|
||||||
|
@@ -577,24 +574,22 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
|
||||||
|
list = list->next;
|
||||||
|
|
||||||
|
akey = expand_assignment_string_to_string (k, 0);
|
||||||
|
- aval = expand_assignment_string_to_string (v, 0);
|
||||||
|
-
|
||||||
|
if (akey == 0 || *akey == 0)
|
||||||
|
{
|
||||||
|
err_badarraysub (k);
|
||||||
|
FREE (akey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ aval = expand_assignment_string_to_string (v, 0);
|
||||||
|
if (aval == 0)
|
||||||
|
{
|
||||||
|
aval = (char *)xmalloc (1);
|
||||||
|
aval[0] = '\0'; /* like do_assignment_internal */
|
||||||
|
- free_aval = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bind_assoc_var_internal (var, h, akey, aval, flags);
|
||||||
|
- if (free_aval)
|
||||||
|
- free (aval);
|
||||||
|
+ free (aval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
index e1429c24..c7f39aec 100644
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 4
|
||||||
|
+#define PATCHLEVEL 5
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
diff --git a/subst.c b/subst.c
|
||||||
|
index 6132316a..1d24188e 100644
|
||||||
|
--- a/subst.c
|
||||||
|
+++ b/subst.c
|
||||||
|
@@ -11673,6 +11673,8 @@ expand_compound_assignment_word (tlist, flags)
|
||||||
|
free (value);
|
||||||
|
|
||||||
|
value = string_list (l);
|
||||||
|
+ dispose_words (l);
|
||||||
|
+
|
||||||
|
wlen = STRLEN (value);
|
||||||
|
|
||||||
|
/* Now, let's rebuild the string */
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
From f3cd936b81006df41a1c8509891dea1edeaef8e6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chet Ramey <chet.ramey@case.edu>
|
||||||
|
Date: Tue, 4 May 2021 14:30:17 -0400
|
||||||
|
Subject: [PATCH] Bash-5.1 patch 6: make sure child processes forked to execute
|
||||||
|
command substitutions are in the right process group
|
||||||
|
|
||||||
|
---
|
||||||
|
patchlevel.h | 2 +-
|
||||||
|
subst.c | 7 +++++++
|
||||||
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
index c7f39aec..6257aeeb 100644
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 5
|
||||||
|
+#define PATCHLEVEL 6
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
diff --git a/subst.c b/subst.c
|
||||||
|
index 1d24188e..462752de 100644
|
||||||
|
--- a/subst.c
|
||||||
|
+++ b/subst.c
|
||||||
|
@@ -6412,6 +6412,13 @@ command_substitute (string, quoted, flags)
|
||||||
|
/* The currently executing shell is not interactive. */
|
||||||
|
interactive = 0;
|
||||||
|
|
||||||
|
+#if defined (JOB_CONTROL)
|
||||||
|
+ /* Invariant: in child processes started to run command substitutions,
|
||||||
|
+ pipeline_pgrp == shell_pgrp. Other parts of the shell assume this. */
|
||||||
|
+ if (pipeline_pgrp > 0 && pipeline_pgrp != shell_pgrp)
|
||||||
|
+ shell_pgrp = pipeline_pgrp;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
set_sigint_handler (); /* XXX */
|
||||||
|
|
||||||
|
free_pushed_string_input ();
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
From b72f88db852104cf49cfb4762eda6e8f4fd20a70 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chet Ramey <chet.ramey@case.edu>
|
||||||
|
Date: Tue, 4 May 2021 14:31:05 -0400
|
||||||
|
Subject: [PATCH] Bash-5.1 patch 7: fix version comparisons in readline startup
|
||||||
|
files
|
||||||
|
|
||||||
|
---
|
||||||
|
lib/readline/bind.c | 15 ++++++++-------
|
||||||
|
patchlevel.h | 2 +-
|
||||||
|
2 files changed, 9 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/readline/bind.c b/lib/readline/bind.c
|
||||||
|
index 87596dce..76103786 100644
|
||||||
|
--- a/lib/readline/bind.c
|
||||||
|
+++ b/lib/readline/bind.c
|
||||||
|
@@ -1234,7 +1234,7 @@ parser_if (char *args)
|
||||||
|
#endif /* VI_MODE */
|
||||||
|
else if (_rl_strnicmp (args, "version", 7) == 0)
|
||||||
|
{
|
||||||
|
- int rlversion, versionarg, op, previ, major, minor;
|
||||||
|
+ int rlversion, versionarg, op, previ, major, minor, opresult;
|
||||||
|
|
||||||
|
_rl_parsing_conditionalized_out = 1;
|
||||||
|
rlversion = RL_VERSION_MAJOR*10 + RL_VERSION_MINOR;
|
||||||
|
@@ -1294,24 +1294,25 @@ parser_if (char *args)
|
||||||
|
switch (op)
|
||||||
|
{
|
||||||
|
case OP_EQ:
|
||||||
|
- _rl_parsing_conditionalized_out = rlversion == versionarg;
|
||||||
|
+ opresult = rlversion == versionarg;
|
||||||
|
break;
|
||||||
|
case OP_NE:
|
||||||
|
- _rl_parsing_conditionalized_out = rlversion != versionarg;
|
||||||
|
+ opresult = rlversion != versionarg;
|
||||||
|
break;
|
||||||
|
case OP_GT:
|
||||||
|
- _rl_parsing_conditionalized_out = rlversion > versionarg;
|
||||||
|
+ opresult = rlversion > versionarg;
|
||||||
|
break;
|
||||||
|
case OP_GE:
|
||||||
|
- _rl_parsing_conditionalized_out = rlversion >= versionarg;
|
||||||
|
+ opresult = rlversion >= versionarg;
|
||||||
|
break;
|
||||||
|
case OP_LT:
|
||||||
|
- _rl_parsing_conditionalized_out = rlversion < versionarg;
|
||||||
|
+ opresult = rlversion < versionarg;
|
||||||
|
break;
|
||||||
|
case OP_LE:
|
||||||
|
- _rl_parsing_conditionalized_out = rlversion <= versionarg;
|
||||||
|
+ opresult = rlversion <= versionarg;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
+ _rl_parsing_conditionalized_out = 1 - opresult;
|
||||||
|
}
|
||||||
|
/* Check to see if the first word in ARGS is the same as the
|
||||||
|
value stored in rl_readline_name. */
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
index 6257aeeb..c5ed66ab 100644
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 6
|
||||||
|
+#define PATCHLEVEL 7
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
From ce23728687ce9e584333367075c9deef413553fa Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chet Ramey <chet.ramey@case.edu>
|
||||||
|
Date: Tue, 4 May 2021 14:31:53 -0400
|
||||||
|
Subject: [PATCH] Bash-5.1 patch 8: clean up FIFOs created by redirections in
|
||||||
|
child processes
|
||||||
|
|
||||||
|
---
|
||||||
|
execute_cmd.c | 8 +++++++-
|
||||||
|
patchlevel.h | 2 +-
|
||||||
|
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||||
|
index d2a0dd71..90129e06 100644
|
||||||
|
--- a/execute_cmd.c
|
||||||
|
+++ b/execute_cmd.c
|
||||||
|
@@ -5556,11 +5556,17 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
|
||||||
|
#if defined (PROCESS_SUBSTITUTION)
|
||||||
|
/* Try to remove named pipes that may have been created as the
|
||||||
|
result of redirections. */
|
||||||
|
- unlink_fifo_list ();
|
||||||
|
+ unlink_all_fifos ();
|
||||||
|
#endif /* PROCESS_SUBSTITUTION */
|
||||||
|
exit (EXECUTION_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if defined (PROCESS_SUBSTITUTION) && !defined (HAVE_DEV_FD)
|
||||||
|
+ /* This should only contain FIFOs created as part of redirection
|
||||||
|
+ expansion. */
|
||||||
|
+ unlink_all_fifos ();
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
if (async)
|
||||||
|
interactive = old_interactive;
|
||||||
|
|
||||||
|
diff --git a/patchlevel.h b/patchlevel.h
|
||||||
|
index c5ed66ab..10fde2ee 100644
|
||||||
|
--- a/patchlevel.h
|
||||||
|
+++ b/patchlevel.h
|
||||||
|
@@ -25,6 +25,6 @@
|
||||||
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
|
-#define PATCHLEVEL 7
|
||||||
|
+#define PATCHLEVEL 8
|
||||||
|
|
||||||
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/lib/readline/rltty.c b/lib/readline/rltty.c
|
||||||
|
--- a/lib/readline/rltty.c
|
||||||
|
+++ b/lib/readline/rltty.c
|
||||||
|
@@ -694,6 +694,8 @@ rl_deprep_terminal (void)
|
||||||
|
fprintf (rl_outstream, BRACK_PASTE_FINI);
|
||||||
|
if (_rl_eof_found)
|
||||||
|
fprintf (rl_outstream, "\n");
|
||||||
|
+ else if (_rl_echoing_p == 0)
|
||||||
|
+ fprintf (rl_outstream, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_rl_enable_keypad)
|
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/subst.c b/subst.c
|
||||||
|
--- a/subst.c
|
||||||
|
+++ b/subst.c
|
||||||
|
@@ -7959,7 +7959,7 @@ parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, fl
|
||||||
|
return ((char *)NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (valid_parameter_transform (xform) == 0)
|
||||||
|
+ if (xform[0] == 0 || valid_parameter_transform (xform) == 0)
|
||||||
|
{
|
||||||
|
this_command_name = oname;
|
||||||
|
#if 0 /* TAG: bash-5.2 Martin Schulte <gnu@schrader-schulte.de> 10/2020 */
|
@ -1,24 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 0
|
|
||||||
+#define PATCHLEVEL 1
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
index d9feabca..93b91606 100644
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -10857,7 +10857,7 @@ expand_array_subscript (string, sindex, quoted, flags)
|
|
||||||
exp = substring (string, si+1, ni);
|
|
||||||
t = expand_subscript_string (exp, quoted & ~(Q_ARITH|Q_DOUBLE_QUOTES));
|
|
||||||
free (exp);
|
|
||||||
- exp = sh_backslash_quote (t, abstab, 0);
|
|
||||||
+ exp = t ? sh_backslash_quote (t, abstab, 0) : savestring ("");
|
|
||||||
free (t);
|
|
||||||
|
|
||||||
slen = STRLEN (exp);
|
|
@ -1,41 +0,0 @@
|
|||||||
diff --git a/general.c b/general.c
|
|
||||||
--- a/general.c
|
|
||||||
+++ b/general.c
|
|
||||||
@@ -683,21 +683,20 @@ check_binary_file (sample, sample_len)
|
|
||||||
int sample_len;
|
|
||||||
{
|
|
||||||
register int i;
|
|
||||||
+ int nline;
|
|
||||||
unsigned char c;
|
|
||||||
|
|
||||||
if (sample_len >= 4 && sample[0] == 0x7f && sample[1] == 'E' && sample[2] == 'L' && sample[3] == 'F')
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
/* Generally we check the first line for NULs. If the first line looks like
|
|
||||||
- a `#!' interpreter specifier, we just look for NULs anywhere in the
|
|
||||||
- buffer. */
|
|
||||||
- if (sample[0] == '#' && sample[1] == '!')
|
|
||||||
- return (memchr (sample, '\0', sample_len) != NULL);
|
|
||||||
+ a `#!' interpreter specifier, we look for NULs in the first two lines. */
|
|
||||||
+ nline = (sample[0] == '#' && sample[1] == '!') ? 2 : 1;
|
|
||||||
|
|
||||||
for (i = 0; i < sample_len; i++)
|
|
||||||
{
|
|
||||||
c = sample[i];
|
|
||||||
- if (c == '\n')
|
|
||||||
+ if (c == '\n' && --nline == 0)
|
|
||||||
return (0);
|
|
||||||
if (c == '\0')
|
|
||||||
return (1);
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
index e59027ac..9ddc79f7 100644
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 9
|
|
||||||
+#define PATCHLEVEL 10
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,25 +0,0 @@
|
|||||||
diff --git a/builtins/read.def b/builtins/read.def
|
|
||||||
--- a/builtins/read.def
|
|
||||||
+++ b/builtins/read.def
|
|
||||||
@@ -167,6 +167,9 @@ reset_timeout ()
|
|
||||||
/* Cancel alarm before restoring signal handler. */
|
|
||||||
if (read_timeout)
|
|
||||||
shtimer_clear (read_timeout);
|
|
||||||
+#if defined (READLINE)
|
|
||||||
+ rl_clear_timeout ();
|
|
||||||
+#endif
|
|
||||||
read_timeout = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
index 9ddc79f7..9ff902a0 100644
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 10
|
|
||||||
+#define PATCHLEVEL 11
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,268 +0,0 @@
|
|||||||
diff --git a/builtins/common.h b/builtins/common.h
|
|
||||||
--- a/builtins/common.h
|
|
||||||
+++ b/builtins/common.h
|
|
||||||
@@ -257,6 +257,10 @@ extern int print_shift_error;
|
|
||||||
extern int expand_once_flag;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
+extern int extglob_flag;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
extern int expaliases_flag;
|
|
||||||
|
|
||||||
/* variables from source.def */
|
|
||||||
diff --git a/builtins/shopt.def b/builtins/shopt.def
|
|
||||||
--- a/builtins/shopt.def
|
|
||||||
+++ b/builtins/shopt.def
|
|
||||||
@@ -149,6 +149,11 @@ static int shopt_set_complete_direxpand PARAMS((char *, int));
|
|
||||||
static int set_assoc_expand PARAMS((char *, int));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
+int extglob_flag = EXTGLOB_DEFAULT;
|
|
||||||
+static int shopt_set_extglob PARAMS((char *, int));
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
int expaliases_flag = 0;
|
|
||||||
static int shopt_set_expaliases PARAMS((char *, int));
|
|
||||||
|
|
||||||
@@ -206,7 +211,7 @@ static struct {
|
|
||||||
{ "extdebug", &debugging_mode, shopt_set_debug_mode },
|
|
||||||
#endif
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
- { "extglob", &extended_glob, (shopt_set_func_t *)NULL },
|
|
||||||
+ { "extglob", &extglob_flag, shopt_set_extglob },
|
|
||||||
#endif
|
|
||||||
{ "extquote", &extended_quote, (shopt_set_func_t *)NULL },
|
|
||||||
{ "failglob", &fail_glob_expansion, (shopt_set_func_t *)NULL },
|
|
||||||
@@ -377,7 +382,7 @@ reset_shopt_options ()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
- extended_glob = EXTGLOB_DEFAULT;
|
|
||||||
+ extended_glob = extglob_flag = EXTGLOB_DEFAULT;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (ARRAY_VARS)
|
|
||||||
@@ -643,6 +648,17 @@ shopt_set_expaliases (option_name, mode)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
+static int
|
|
||||||
+shopt_set_extglob (option_name, mode)
|
|
||||||
+ char *option_name;
|
|
||||||
+ int mode;
|
|
||||||
+{
|
|
||||||
+ extended_glob = extglob_flag;
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if defined (READLINE)
|
|
||||||
static int
|
|
||||||
shopt_enable_hostname_completion (option_name, mode)
|
|
||||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
|
||||||
--- a/execute_cmd.c
|
|
||||||
+++ b/execute_cmd.c
|
|
||||||
@@ -3990,13 +3990,11 @@ execute_cond_node (cond)
|
|
||||||
else
|
|
||||||
#endif /* COND_REGEXP */
|
|
||||||
{
|
|
||||||
- int oe;
|
|
||||||
- oe = extended_glob;
|
|
||||||
extended_glob = 1;
|
|
||||||
result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE)
|
|
||||||
? EXECUTION_SUCCESS
|
|
||||||
: EXECUTION_FAILURE;
|
|
||||||
- extended_glob = oe;
|
|
||||||
+ extended_glob = extglob_flag;
|
|
||||||
}
|
|
||||||
if (arg1 != nullstr)
|
|
||||||
free (arg1);
|
|
||||||
diff --git a/parse.y b/parse.y
|
|
||||||
--- a/parse.y
|
|
||||||
+++ b/parse.y
|
|
||||||
@@ -125,7 +125,7 @@ do { \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
-extern int extended_glob;
|
|
||||||
+extern int extended_glob, extglob_flag;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (TRANSLATABLE_STRINGS)
|
|
||||||
@@ -3304,7 +3304,7 @@ reset_parser ()
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
/* Reset to global value of extended glob */
|
|
||||||
if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
|
|
||||||
- extended_glob = global_extglob;
|
|
||||||
+ extended_glob = extglob_flag;
|
|
||||||
#endif
|
|
||||||
if (parser_state & (PST_CMDSUBST|PST_STRING))
|
|
||||||
expand_aliases = expaliases_flag;
|
|
||||||
@@ -4124,10 +4124,10 @@ parse_comsub (qc, open, close, lenp, flags)
|
|
||||||
expand_aliases = posixly_correct != 0;
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
|
|
||||||
- conditional command and have already set global_extglob appropriately. */
|
|
||||||
+ conditional command and have already set extended_glob appropriately. */
|
|
||||||
if (shell_compatibility_level <= 51 && was_extpat == 0)
|
|
||||||
{
|
|
||||||
- local_extglob = global_extglob = extended_glob;
|
|
||||||
+ local_extglob = extended_glob;
|
|
||||||
extended_glob = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -4235,7 +4235,7 @@ xparse_dolparen (base, string, indp, flags)
|
|
||||||
{
|
|
||||||
sh_parser_state_t ps;
|
|
||||||
sh_input_line_state_t ls;
|
|
||||||
- int orig_ind, nc, sflags, start_lineno;
|
|
||||||
+ int orig_ind, nc, sflags, start_lineno, local_extglob;
|
|
||||||
char *ret, *ep, *ostring;
|
|
||||||
|
|
||||||
/*debug_parser(1);*/
|
|
||||||
@@ -4278,7 +4278,7 @@ xparse_dolparen (base, string, indp, flags)
|
|
||||||
old value will be restored by restore_parser_state(). */
|
|
||||||
expand_aliases = 0;
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
- global_extglob = extended_glob; /* for reset_parser() */
|
|
||||||
+ local_extglob = extended_glob;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
token_to_read = DOLPAREN; /* let's trick the parser */
|
|
||||||
@@ -4296,6 +4296,9 @@ xparse_dolparen (base, string, indp, flags)
|
|
||||||
restore_input_line_state (&ls);
|
|
||||||
restore_parser_state (&ps);
|
|
||||||
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
+ extended_glob = local_extglob;
|
|
||||||
+#endif
|
|
||||||
token_to_read = 0;
|
|
||||||
|
|
||||||
/* If parse_string returns < 0, we need to jump to top level with the
|
|
||||||
@@ -4731,12 +4734,16 @@ cond_term ()
|
|
||||||
}
|
|
||||||
|
|
||||||
/* rhs */
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
local_extglob = extended_glob;
|
|
||||||
if (parser_state & PST_EXTPAT)
|
|
||||||
extended_glob = 1;
|
|
||||||
+#endif
|
|
||||||
tok = read_token (READ);
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
if (parser_state & PST_EXTPAT)
|
|
||||||
extended_glob = local_extglob;
|
|
||||||
+#endif
|
|
||||||
parser_state &= ~(PST_REGEXP|PST_EXTPAT);
|
|
||||||
|
|
||||||
if (tok == WORD)
|
|
||||||
@@ -4783,7 +4790,6 @@ parse_cond_command ()
|
|
||||||
{
|
|
||||||
COND_COM *cexp;
|
|
||||||
|
|
||||||
- global_extglob = extended_glob;
|
|
||||||
cexp = cond_expr ();
|
|
||||||
return (make_cond_command (cexp));
|
|
||||||
}
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 11
|
|
||||||
+#define PATCHLEVEL 12
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/y.tab.c b/y.tab.c
|
|
||||||
--- a/y.tab.c
|
|
||||||
+++ b/y.tab.c
|
|
||||||
@@ -175,7 +175,7 @@ do { \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
-extern int extended_glob;
|
|
||||||
+extern int extended_glob, extglob_flag;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (TRANSLATABLE_STRINGS)
|
|
||||||
@@ -5615,7 +5615,7 @@ reset_parser ()
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
/* Reset to global value of extended glob */
|
|
||||||
if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
|
|
||||||
- extended_glob = global_extglob;
|
|
||||||
+ extended_glob = extglob_flag;
|
|
||||||
#endif
|
|
||||||
if (parser_state & (PST_CMDSUBST|PST_STRING))
|
|
||||||
expand_aliases = expaliases_flag;
|
|
||||||
@@ -6435,10 +6435,10 @@ parse_comsub (qc, open, close, lenp, flags)
|
|
||||||
expand_aliases = posixly_correct != 0;
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
|
|
||||||
- conditional command and have already set global_extglob appropriately. */
|
|
||||||
+ conditional command and have already set extended_glob appropriately. */
|
|
||||||
if (shell_compatibility_level <= 51 && was_extpat == 0)
|
|
||||||
{
|
|
||||||
- local_extglob = global_extglob = extended_glob;
|
|
||||||
+ local_extglob = extended_glob;
|
|
||||||
extended_glob = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -6546,7 +6546,7 @@ xparse_dolparen (base, string, indp, flags)
|
|
||||||
{
|
|
||||||
sh_parser_state_t ps;
|
|
||||||
sh_input_line_state_t ls;
|
|
||||||
- int orig_ind, nc, sflags, start_lineno;
|
|
||||||
+ int orig_ind, nc, sflags, start_lineno, local_extglob;
|
|
||||||
char *ret, *ep, *ostring;
|
|
||||||
|
|
||||||
/*debug_parser(1);*/
|
|
||||||
@@ -6589,7 +6589,7 @@ xparse_dolparen (base, string, indp, flags)
|
|
||||||
old value will be restored by restore_parser_state(). */
|
|
||||||
expand_aliases = 0;
|
|
||||||
#if defined (EXTENDED_GLOB)
|
|
||||||
- global_extglob = extended_glob; /* for reset_parser() */
|
|
||||||
+ local_extglob = extended_glob;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
token_to_read = DOLPAREN; /* let's trick the parser */
|
|
||||||
@@ -6607,6 +6607,9 @@ xparse_dolparen (base, string, indp, flags)
|
|
||||||
restore_input_line_state (&ls);
|
|
||||||
restore_parser_state (&ps);
|
|
||||||
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
+ extended_glob = local_extglob;
|
|
||||||
+#endif
|
|
||||||
token_to_read = 0;
|
|
||||||
|
|
||||||
/* If parse_string returns < 0, we need to jump to top level with the
|
|
||||||
@@ -7042,12 +7045,16 @@ cond_term ()
|
|
||||||
}
|
|
||||||
|
|
||||||
/* rhs */
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
local_extglob = extended_glob;
|
|
||||||
if (parser_state & PST_EXTPAT)
|
|
||||||
extended_glob = 1;
|
|
||||||
+#endif
|
|
||||||
tok = read_token (READ);
|
|
||||||
+#if defined (EXTENDED_GLOB)
|
|
||||||
if (parser_state & PST_EXTPAT)
|
|
||||||
extended_glob = local_extglob;
|
|
||||||
+#endif
|
|
||||||
parser_state &= ~(PST_REGEXP|PST_EXTPAT);
|
|
||||||
|
|
||||||
if (tok == WORD)
|
|
||||||
@@ -7094,7 +7101,6 @@ parse_cond_command ()
|
|
||||||
{
|
|
||||||
COND_COM *cexp;
|
|
||||||
|
|
||||||
- global_extglob = extended_glob;
|
|
||||||
cexp = cond_expr ();
|
|
||||||
return (make_cond_command (cexp));
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 12
|
|
||||||
+#define PATCHLEVEL 13
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -7497,8 +7497,6 @@ expand_arrayref:
|
|
||||||
? quote_string (temp)
|
|
||||||
: quote_escapes (temp);
|
|
||||||
rflags |= W_ARRAYIND;
|
|
||||||
- if (estatep)
|
|
||||||
- *estatep = es; /* structure copy */
|
|
||||||
}
|
|
||||||
/* Note that array[*] and array[@] expanded to a quoted null string by
|
|
||||||
returning the W_HASQUOTEDNULL flag to the caller in addition to TEMP. */
|
|
||||||
@@ -7507,7 +7505,9 @@ expand_arrayref:
|
|
||||||
else if (es.subtype == 2 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)))
|
|
||||||
rflags |= W_HASQUOTEDNULL;
|
|
||||||
|
|
||||||
- if (estatep == 0)
|
|
||||||
+ if (estatep)
|
|
||||||
+ *estatep = es; /* structure copy */
|
|
||||||
+ else
|
|
||||||
flush_eltstate (&es);
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1,93 +0,0 @@
|
|||||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
|
||||||
--- a/execute_cmd.c
|
|
||||||
+++ b/execute_cmd.c
|
|
||||||
@@ -3624,6 +3624,7 @@ execute_case_command (case_command)
|
|
||||||
free (pattern);
|
|
||||||
|
|
||||||
dispose_words (es);
|
|
||||||
+ QUIT;
|
|
||||||
|
|
||||||
if (match)
|
|
||||||
{
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 13
|
|
||||||
+#define PATCHLEVEL 14
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/sig.c b/sig.c
|
|
||||||
--- a/sig.c
|
|
||||||
+++ b/sig.c
|
|
||||||
@@ -94,6 +94,7 @@ static SigHandler *old_winch = (SigHandler *)SIG_DFL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void initialize_shell_signals PARAMS((void));
|
|
||||||
+static void kill_shell PARAMS((int));
|
|
||||||
|
|
||||||
void
|
|
||||||
initialize_signals (reinit)
|
|
||||||
@@ -486,6 +487,8 @@ restore_sigmask ()
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int handling_termsig = 0;
|
|
||||||
+
|
|
||||||
sighandler
|
|
||||||
termsig_sighandler (sig)
|
|
||||||
int sig;
|
|
||||||
@@ -532,6 +535,14 @@ termsig_sighandler (sig)
|
|
||||||
sig == terminating_signal)
|
|
||||||
terminate_immediately = 1;
|
|
||||||
|
|
||||||
+ /* If we are currently handling a terminating signal, we have a couple of
|
|
||||||
+ choices here. We can ignore this second terminating signal and let the
|
|
||||||
+ shell exit from the first one, or we can exit immediately by killing
|
|
||||||
+ the shell with this signal. This code implements the latter; to implement
|
|
||||||
+ the former, replace the kill_shell(sig) with return. */
|
|
||||||
+ if (handling_termsig)
|
|
||||||
+ kill_shell (sig); /* just short-circuit now */
|
|
||||||
+
|
|
||||||
terminating_signal = sig;
|
|
||||||
|
|
||||||
if (terminate_immediately)
|
|
||||||
@@ -564,16 +575,13 @@ void
|
|
||||||
termsig_handler (sig)
|
|
||||||
int sig;
|
|
||||||
{
|
|
||||||
- static int handling_termsig = 0;
|
|
||||||
- int i, core;
|
|
||||||
- sigset_t mask;
|
|
||||||
-
|
|
||||||
/* Simple semaphore to keep this function from being executed multiple
|
|
||||||
times. Since we no longer are running as a signal handler, we don't
|
|
||||||
block multiple occurrences of the terminating signals while running. */
|
|
||||||
if (handling_termsig)
|
|
||||||
return;
|
|
||||||
- handling_termsig = 1;
|
|
||||||
+
|
|
||||||
+ handling_termsig = terminating_signal; /* for termsig_sighandler */
|
|
||||||
terminating_signal = 0; /* keep macro from re-testing true. */
|
|
||||||
|
|
||||||
/* I don't believe this condition ever tests true. */
|
|
||||||
@@ -613,6 +621,16 @@ termsig_handler (sig)
|
|
||||||
|
|
||||||
run_exit_trap (); /* XXX - run exit trap possibly in signal context? */
|
|
||||||
|
|
||||||
+ kill_shell (sig);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+kill_shell (sig)
|
|
||||||
+ int sig;
|
|
||||||
+{
|
|
||||||
+ int i, core;
|
|
||||||
+ sigset_t mask;
|
|
||||||
+
|
|
||||||
/* We don't change the set of blocked signals. If a user starts the shell
|
|
||||||
with a terminating signal blocked, we won't get here (and if by some
|
|
||||||
magic chance we do, we'll exit below). What we do is to restore the
|
|
@ -1,163 +0,0 @@
|
|||||||
diff --git a/builtins/common.h b/builtins/common.h
|
|
||||||
--- a/builtins/common.h
|
|
||||||
+++ b/builtins/common.h
|
|
||||||
@@ -51,6 +51,7 @@ do { \
|
|
||||||
#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */
|
|
||||||
#define SEVAL_ONECMD 0x100 /* only allow a single command */
|
|
||||||
#define SEVAL_NOHISTEXP 0x200 /* inhibit history expansion */
|
|
||||||
+#define SEVAL_NOOPTIMIZE 0x400 /* don't try to set optimization flags */
|
|
||||||
|
|
||||||
/* Flags for describe_command, shared between type.def and command.def */
|
|
||||||
#define CDESC_ALL 0x001 /* type -a */
|
|
||||||
diff --git a/builtins/eval.def b/builtins/eval.def
|
|
||||||
--- a/builtins/eval.def
|
|
||||||
+++ b/builtins/eval.def
|
|
||||||
@@ -53,5 +53,5 @@ eval_builtin (list)
|
|
||||||
return (EX_USAGE);
|
|
||||||
list = loptend; /* skip over possible `--' */
|
|
||||||
|
|
||||||
- return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST) : EXECUTION_SUCCESS);
|
|
||||||
+ return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST|SEVAL_NOOPTIMIZE) : EXECUTION_SUCCESS);
|
|
||||||
}
|
|
||||||
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
|
|
||||||
--- a/builtins/evalstring.c
|
|
||||||
+++ b/builtins/evalstring.c
|
|
||||||
@@ -132,8 +132,8 @@ optimize_connection_fork (command)
|
|
||||||
if (command->type == cm_connection &&
|
|
||||||
(command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
|
|
||||||
(command->value.Connection->second->flags & CMD_TRY_OPTIMIZING) &&
|
|
||||||
- ((startup_state == 2 && should_suppress_fork (command->value.Connection->second)) ||
|
|
||||||
- ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork (command->value.Connection->second, 0))))
|
|
||||||
+ (should_suppress_fork (command->value.Connection->second) ||
|
|
||||||
+ ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork (command->value.Connection->second, 0))))
|
|
||||||
{
|
|
||||||
command->value.Connection->second->flags |= CMD_NO_FORK;
|
|
||||||
command->value.Connection->second->value.Simple->flags |= CMD_NO_FORK;
|
|
||||||
@@ -290,6 +290,7 @@ parse_prologue (string, flags, tag)
|
|
||||||
(flags & SEVAL_NOFREE) -> don't free STRING when finished
|
|
||||||
(flags & SEVAL_RESETLINE) -> reset line_number to 1
|
|
||||||
(flags & SEVAL_NOHISTEXP) -> history_expansion_inhibited -> 1
|
|
||||||
+ (flags & SEVAL_NOOPTIMIZE) -> don't try to turn on optimizing flags
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
@@ -502,7 +503,9 @@ parse_and_execute (string, from_file, flags)
|
|
||||||
if we are at the end of the command string, the last in a
|
|
||||||
series of connection commands is
|
|
||||||
command->value.Connection->second. */
|
|
||||||
- else if (command->type == cm_connection && can_optimize_connection (command))
|
|
||||||
+ else if (command->type == cm_connection &&
|
|
||||||
+ (flags & SEVAL_NOOPTIMIZE) == 0 &&
|
|
||||||
+ can_optimize_connection (command))
|
|
||||||
{
|
|
||||||
command->value.Connection->second->flags |= CMD_TRY_OPTIMIZING;
|
|
||||||
command->value.Connection->second->value.Simple->flags |= CMD_TRY_OPTIMIZING;
|
|
||||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
|
||||||
--- a/execute_cmd.c
|
|
||||||
+++ b/execute_cmd.c
|
|
||||||
@@ -1654,7 +1654,8 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
|
||||||
subshell sets an exit trap, so we set CMD_NO_FORK for simple commands
|
|
||||||
and set CMD_TRY_OPTIMIZING for simple commands on the right side of an
|
|
||||||
and-or or `;' list to test for optimizing forks when they are executed. */
|
|
||||||
- if (user_subshell && command->type == cm_subshell)
|
|
||||||
+ if (user_subshell && command->type == cm_subshell &&
|
|
||||||
+ (command->flags & (CMD_TIME_PIPELINE|CMD_INVERT_RETURN)) == 0)
|
|
||||||
optimize_subshell_command (command->value.Subshell->command);
|
|
||||||
|
|
||||||
/* Do redirections, then dispose of them before recursive call. */
|
|
||||||
diff --git a/jobs.c b/jobs.c
|
|
||||||
--- a/jobs.c
|
|
||||||
+++ b/jobs.c
|
|
||||||
@@ -4220,7 +4220,7 @@ run_sigchld_trap (nchild)
|
|
||||||
jobs_list_frozen = 1;
|
|
||||||
for (i = 0; i < nchild; i++)
|
|
||||||
{
|
|
||||||
- parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE);
|
|
||||||
+ parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
run_unwind_frame ("SIGCHLD trap");
|
|
||||||
diff --git a/parse.y b/parse.y
|
|
||||||
--- a/parse.y
|
|
||||||
+++ b/parse.y
|
|
||||||
@@ -2827,7 +2827,7 @@ execute_variable_command (command, vname)
|
|
||||||
if (last_lastarg)
|
|
||||||
last_lastarg = savestring (last_lastarg);
|
|
||||||
|
|
||||||
- parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST);
|
|
||||||
+ parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE);
|
|
||||||
|
|
||||||
restore_parser_state (&ps);
|
|
||||||
bind_variable ("_", last_lastarg, 0);
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 14
|
|
||||||
+#define PATCHLEVEL 15
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/trap.c b/trap.c
|
|
||||||
--- a/trap.c
|
|
||||||
+++ b/trap.c
|
|
||||||
@@ -304,6 +304,7 @@ run_pending_traps ()
|
|
||||||
sh_parser_state_t pstate;
|
|
||||||
volatile int save_return_catch_flag, function_code;
|
|
||||||
procenv_t save_return_catch;
|
|
||||||
+ char *trap_command, *old_trap;
|
|
||||||
#if defined (ARRAY_VARS)
|
|
||||||
ARRAY *ps;
|
|
||||||
#endif
|
|
||||||
@@ -419,6 +420,9 @@ run_pending_traps ()
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
+ old_trap = trap_list[sig];
|
|
||||||
+ trap_command = savestring (old_trap);
|
|
||||||
+
|
|
||||||
save_parser_state (&pstate);
|
|
||||||
save_subst_varlist = subst_assign_varlist;
|
|
||||||
subst_assign_varlist = 0;
|
|
||||||
@@ -441,7 +445,8 @@ run_pending_traps ()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (function_code == 0)
|
|
||||||
- x = parse_and_execute (savestring (trap_list[sig]), "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
|
|
||||||
+ /* XXX is x always last_command_exit_value? */
|
|
||||||
+ x = parse_and_execute (trap_command, "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
parse_and_execute_cleanup (sig + 1); /* XXX - could use -1 */
|
|
||||||
@@ -1002,7 +1007,7 @@ run_exit_trap ()
|
|
||||||
if (code == 0 && function_code == 0)
|
|
||||||
{
|
|
||||||
reset_parser ();
|
|
||||||
- parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
|
|
||||||
+ parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
|
|
||||||
}
|
|
||||||
else if (code == ERREXIT)
|
|
||||||
retval = last_command_exit_value;
|
|
||||||
@@ -1109,7 +1114,7 @@ _run_trap_internal (sig, tag)
|
|
||||||
function_code = setjmp_nosigs (return_catch);
|
|
||||||
}
|
|
||||||
|
|
||||||
- flags = SEVAL_NONINT|SEVAL_NOHIST;
|
|
||||||
+ flags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE;
|
|
||||||
if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP)
|
|
||||||
flags |= SEVAL_RESETLINE;
|
|
||||||
evalnest++;
|
|
||||||
diff --git a/y.tab.c b/y.tab.c
|
|
||||||
--- a/y.tab.c
|
|
||||||
+++ b/y.tab.c
|
|
||||||
@@ -5138,7 +5138,7 @@ execute_variable_command (command, vname)
|
|
||||||
if (last_lastarg)
|
|
||||||
last_lastarg = savestring (last_lastarg);
|
|
||||||
|
|
||||||
- parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST);
|
|
||||||
+ parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE);
|
|
||||||
|
|
||||||
restore_parser_state (&ps);
|
|
||||||
bind_variable ("_", last_lastarg, 0);
|
|
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@
|
|||||||
diff --git a/builtins/evalfile.c b/builtins/evalfile.c
|
|
||||||
--- a/builtins/evalfile.c
|
|
||||||
+++ b/builtins/evalfile.c
|
|
||||||
@@ -266,7 +266,7 @@ file_error_and_exit:
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* set the flags to be passed to parse_and_execute */
|
|
||||||
- pflags = SEVAL_RESETLINE;
|
|
||||||
+ pflags = SEVAL_RESETLINE|SEVAL_NOOPTIMIZE;
|
|
||||||
pflags |= (flags & FEVAL_HISTORY) ? 0 : SEVAL_NOHIST;
|
|
||||||
|
|
||||||
if (flags & FEVAL_BUILTIN)
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 16
|
|
||||||
+#define PATCHLEVEL 17
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
File diff suppressed because it is too large
Load Diff
@ -1,38 +0,0 @@
|
|||||||
diff --git a/jobs.c b/jobs.c
|
|
||||||
--- a/jobs.c
|
|
||||||
+++ b/jobs.c
|
|
||||||
@@ -3077,9 +3077,13 @@ if (job == NO_JOB)
|
|
||||||
/* Don't modify terminal pgrp if we are running in background or a
|
|
||||||
subshell. Make sure subst.c:command_substitute uses the same
|
|
||||||
conditions to determine whether or not it should undo this and
|
|
||||||
- give the terminal to pipeline_pgrp. */
|
|
||||||
-
|
|
||||||
+ give the terminal to pipeline_pgrp. We don't give the terminal
|
|
||||||
+ back to shell_pgrp if an async job in the background exits because
|
|
||||||
+ we never gave it to that job in the first place. An async job in
|
|
||||||
+ the foreground is one we started in the background and foregrounded
|
|
||||||
+ with `fg', and gave it the terminal. */
|
|
||||||
if ((flags & JWAIT_NOTERM) == 0 && running_in_background == 0 &&
|
|
||||||
+ (job == NO_JOB || IS_ASYNC (job) == 0 || IS_FOREGROUND (job)) &&
|
|
||||||
(subshell_environment & (SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0)
|
|
||||||
give_terminal_to (shell_pgrp, 0);
|
|
||||||
}
|
|
||||||
@@ -3623,6 +3627,7 @@ start_job (job, foreground)
|
|
||||||
{
|
|
||||||
get_tty_state ();
|
|
||||||
save_stty = shell_tty_info;
|
|
||||||
+ jobs[job]->flags &= ~J_ASYNC; /* no longer async */
|
|
||||||
/* Give the terminal to this job. */
|
|
||||||
if (IS_JOBCONTROL (job))
|
|
||||||
give_terminal_to (jobs[job]->pgrp, 0);
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 18
|
|
||||||
+#define PATCHLEVEL 19
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,25 +0,0 @@
|
|||||||
diff --git a/lib/readline/nls.c b/lib/readline/nls.c
|
|
||||||
--- a/lib/readline/nls.c
|
|
||||||
+++ b/lib/readline/nls.c
|
|
||||||
@@ -141,6 +141,10 @@ _rl_init_locale (void)
|
|
||||||
if (lspec == 0)
|
|
||||||
lspec = "";
|
|
||||||
ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
|
|
||||||
+ if (ret == 0 || *ret == 0)
|
|
||||||
+ ret = setlocale (LC_CTYPE, (char *)NULL);
|
|
||||||
+ if (ret == 0 || *ret == 0)
|
|
||||||
+ ret = RL_DEFAULT_LOCALE;
|
|
||||||
#else
|
|
||||||
ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
|
|
||||||
#endif
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 1
|
|
||||||
+#define PATCHLEVEL 2
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,33 +0,0 @@
|
|||||||
diff --git a/parse.y b/parse.y
|
|
||||||
--- a/parse.y
|
|
||||||
+++ b/parse.y
|
|
||||||
@@ -3150,6 +3150,7 @@ time_command_acceptable ()
|
|
||||||
case TIME: /* time time pipeline */
|
|
||||||
case TIMEOPT: /* time -p time pipeline */
|
|
||||||
case TIMEIGN: /* time -p -- ... */
|
|
||||||
+ case DOLPAREN:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 19
|
|
||||||
+#define PATCHLEVEL 20
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/y.tab.c b/y.tab.c
|
|
||||||
--- a/y.tab.c
|
|
||||||
+++ b/y.tab.c
|
|
||||||
@@ -5465,6 +5465,7 @@ time_command_acceptable ()
|
|
||||||
case TIME: /* time time pipeline */
|
|
||||||
case TIMEOPT: /* time -p time pipeline */
|
|
||||||
case TIMEIGN: /* time -p -- ... */
|
|
||||||
+ case DOLPAREN:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
@ -1,32 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 20
|
|
||||||
+#define PATCHLEVEL 21
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -1693,7 +1693,7 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags)
|
|
||||||
t = extract_command_subst (string, &si, flags);
|
|
||||||
CHECK_STRING_OVERRUN (i, si, slen, c);
|
|
||||||
|
|
||||||
- tlen = si - i - 1;
|
|
||||||
+ tlen = si - i - 2;
|
|
||||||
RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64);
|
|
||||||
result[result_index++] = c;
|
|
||||||
result[result_index++] = LPAREN;
|
|
||||||
@@ -1713,7 +1713,7 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags)
|
|
||||||
t = extract_process_subst (string, (string[i] == '<' ? "<(" : ">)"), &si, flags);
|
|
||||||
CHECK_STRING_OVERRUN (i, si, slen, c);
|
|
||||||
|
|
||||||
- tlen = si - i - 1;
|
|
||||||
+ tlen = si - i - 2;
|
|
||||||
RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64);
|
|
||||||
result[result_index++] = c;
|
|
||||||
result[result_index++] = LPAREN;
|
|
@ -1,29 +0,0 @@
|
|||||||
diff --git a/lib/readline/display.c b/lib/readline/display.c
|
|
||||||
--- a/lib/readline/display.c
|
|
||||||
+++ b/lib/readline/display.c
|
|
||||||
@@ -2683,11 +2683,8 @@ rl_forced_update_display (void)
|
|
||||||
register char *temp;
|
|
||||||
|
|
||||||
if (visible_line)
|
|
||||||
- {
|
|
||||||
- temp = visible_line;
|
|
||||||
- while (*temp)
|
|
||||||
- *temp++ = '\0';
|
|
||||||
- }
|
|
||||||
+ memset (visible_line, 0, line_size);
|
|
||||||
+
|
|
||||||
rl_on_new_line ();
|
|
||||||
forced_display++;
|
|
||||||
(*rl_redisplay_function) ();
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
index 1712b108..e5e8cabd 100644
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 21
|
|
||||||
+#define PATCHLEVEL 22
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,38 +0,0 @@
|
|||||||
diff --git a/builtins/declare.def b/builtins/declare.def
|
|
||||||
--- a/builtins/declare.def
|
|
||||||
+++ b/builtins/declare.def
|
|
||||||
@@ -420,11 +420,19 @@ declare_internal (list, local_var)
|
|
||||||
|
|
||||||
if (local_var && variable_context && STREQ (name, "-"))
|
|
||||||
{
|
|
||||||
+ int o;
|
|
||||||
+
|
|
||||||
+ o = localvar_inherit;
|
|
||||||
+ localvar_inherit = 0;
|
|
||||||
var = make_local_variable ("-", 0);
|
|
||||||
- FREE (value_cell (var)); /* just in case */
|
|
||||||
- value = get_current_options ();
|
|
||||||
- var_setvalue (var, value);
|
|
||||||
- VSETATTR (var, att_invisible);
|
|
||||||
+ localvar_inherit = o;
|
|
||||||
+
|
|
||||||
+ if (value_cell (var) == NULL) /* no duplicate instances */
|
|
||||||
+ {
|
|
||||||
+ value = get_current_options ();
|
|
||||||
+ var_setvalue (var, value);
|
|
||||||
+ VSETATTR (var, att_invisible);
|
|
||||||
+ }
|
|
||||||
NEXT_VARIABLE ();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 22
|
|
||||||
+#define PATCHLEVEL 23
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,56 +0,0 @@
|
|||||||
diff --git a/arrayfunc.c b/arrayfunc.c
|
|
||||||
--- a/arrayfunc.c
|
|
||||||
+++ b/arrayfunc.c
|
|
||||||
@@ -650,7 +650,7 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
- aval = expand_subscript_string (v, 0);
|
|
||||||
+ aval = expand_assignment_string_to_string (v, 0);
|
|
||||||
if (aval == 0)
|
|
||||||
{
|
|
||||||
aval = (char *)xmalloc (1);
|
|
||||||
@@ -842,7 +842,7 @@ assign_compound_array_list (var, nlist, flags)
|
|
||||||
/* See above; we need to expand the value here */
|
|
||||||
if (assoc_p (var))
|
|
||||||
{
|
|
||||||
- val = expand_subscript_string (val, 0);
|
|
||||||
+ val = expand_assignment_string_to_string (val, 0);
|
|
||||||
if (val == 0)
|
|
||||||
{
|
|
||||||
val = (char *)xmalloc (1);
|
|
||||||
@@ -1030,7 +1030,7 @@ expand_and_quote_assoc_word (w, type)
|
|
||||||
nword[i++] = w[ind++];
|
|
||||||
nword[i++] = w[ind++];
|
|
||||||
|
|
||||||
- t = expand_subscript_string (w+ind, 0);
|
|
||||||
+ t = expand_assignment_string_to_string (w+ind, 0);
|
|
||||||
s = (t && strchr (t, CTLESC)) ? quote_escapes (t) : t;
|
|
||||||
value = sh_single_quote (s ? s : "");
|
|
||||||
if (s != t)
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 23
|
|
||||||
+#define PATCHLEVEL 24
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -10802,7 +10802,11 @@ expand_subscript_string (string, quoted)
|
|
||||||
oe = expand_no_split_dollar_star;
|
|
||||||
ret = (char *)NULL;
|
|
||||||
|
|
||||||
+#if 0
|
|
||||||
td.flags = W_NOPROCSUB|W_NOTILDE|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */
|
|
||||||
+#else
|
|
||||||
+ td.flags = W_NOPROCSUB|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */
|
|
||||||
+#endif
|
|
||||||
td.word = savestring (string); /* in case it's freed on error */
|
|
||||||
|
|
||||||
expand_no_split_dollar_star = 1;
|
|
@ -1,24 +0,0 @@
|
|||||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
|
||||||
--- a/execute_cmd.c
|
|
||||||
+++ b/execute_cmd.c
|
|
||||||
@@ -1725,6 +1725,9 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
|
||||||
return_code = (return_code == EXECUTION_SUCCESS) ? EXECUTION_FAILURE
|
|
||||||
: EXECUTION_SUCCESS;
|
|
||||||
|
|
||||||
+ /* Check for terminating signals before we return to our caller, which we
|
|
||||||
+ expect to exit immediately anyway. */
|
|
||||||
+ CHECK_TERMSIG;
|
|
||||||
|
|
||||||
/* If we were explicitly placed in a subshell with (), we need
|
|
||||||
to do the `shell cleanup' things, such as running traps[0]. */
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 24
|
|
||||||
+#define PATCHLEVEL 25
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,23 +0,0 @@
|
|||||||
diff --git a/lib/readline/colors.c b/lib/readline/colors.c
|
|
||||||
--- a/lib/readline/colors.c
|
|
||||||
+++ b/lib/readline/colors.c
|
|
||||||
@@ -73,7 +73,7 @@
|
|
||||||
static bool is_colored (enum indicator_no type);
|
|
||||||
static void restore_default_color (void);
|
|
||||||
|
|
||||||
-#define RL_COLOR_PREFIX_EXTENSION "readline-colored-completion-prefix"
|
|
||||||
+#define RL_COLOR_PREFIX_EXTENSION ".readline-colored-completion-prefix"
|
|
||||||
|
|
||||||
COLOR_EXT_TYPE *_rl_color_ext_list = 0;
|
|
||||||
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 25
|
|
||||||
+#define PATCHLEVEL 26
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -1,60 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 2
|
|
||||||
+#define PATCHLEVEL 3
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/print_cmd.c b/print_cmd.c
|
|
||||||
--- a/print_cmd.c
|
|
||||||
+++ b/print_cmd.c
|
|
||||||
@@ -297,10 +297,12 @@ make_command_string_internal (command)
|
|
||||||
case '\n': /* special case this */
|
|
||||||
{
|
|
||||||
char c = command->value.Connection->connector;
|
|
||||||
+ int was_newline;
|
|
||||||
|
|
||||||
s[0] = printing_comsub ? c : ';';
|
|
||||||
s[1] = '\0';
|
|
||||||
|
|
||||||
+ was_newline = deferred_heredocs == 0 && was_heredoc == 0 && c == '\n';
|
|
||||||
if (deferred_heredocs == 0)
|
|
||||||
{
|
|
||||||
if (was_heredoc == 0)
|
|
||||||
@@ -314,6 +316,8 @@ make_command_string_internal (command)
|
|
||||||
|
|
||||||
if (inside_function_def)
|
|
||||||
cprintf ("\n");
|
|
||||||
+ else if (printing_comsub && c == '\n' && was_newline == 0)
|
|
||||||
+ cprintf ("\n"); /* preserve newlines in comsubs but don't double them */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (c == ';')
|
|
||||||
@@ -1365,7 +1369,11 @@ print_function_def (func)
|
|
||||||
cmdcopy->redirects = func_redirects;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
- newline ("}");
|
|
||||||
+ {
|
|
||||||
+ /* { */
|
|
||||||
+ newline ("}");
|
|
||||||
+ was_heredoc = 0; /* not printing any here-documents now */
|
|
||||||
+ }
|
|
||||||
|
|
||||||
dispose_command (cmdcopy);
|
|
||||||
}
|
|
||||||
@@ -1442,7 +1450,10 @@ named_function_string (name, command, flags)
|
|
||||||
cmdcopy->redirects = func_redirects;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
- newline ("}");
|
|
||||||
+ { /* { */
|
|
||||||
+ newline ("}");
|
|
||||||
+ was_heredoc = 0;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
result = the_printed_command;
|
|
@ -1,50 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 3
|
|
||||||
+#define PATCHLEVEL 4
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -1798,6 +1798,9 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags)
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
+#define PARAMEXPNEST_MAX 32 // for now
|
|
||||||
+static int dbstate[PARAMEXPNEST_MAX];
|
|
||||||
+
|
|
||||||
/* Extract a parameter expansion expression within ${ and } from STRING.
|
|
||||||
Obey the Posix.2 rules for finding the ending `}': count braces while
|
|
||||||
skipping over enclosed quoted strings and command substitutions.
|
|
||||||
@@ -1828,6 +1831,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
|
||||||
if (quoted == Q_HERE_DOCUMENT && dolbrace_state == DOLBRACE_QUOTE && (flags & SX_NOALLOC) == 0)
|
|
||||||
return (extract_heredoc_dolbrace_string (string, sindex, quoted, flags));
|
|
||||||
|
|
||||||
+ dbstate[0] = dolbrace_state;
|
|
||||||
+
|
|
||||||
pass_character = 0;
|
|
||||||
nesting_level = 1;
|
|
||||||
slen = strlen (string + *sindex) + *sindex;
|
|
||||||
@@ -1852,6 +1857,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
|
||||||
|
|
||||||
if (string[i] == '$' && string[i+1] == LBRACE)
|
|
||||||
{
|
|
||||||
+ if (nesting_level < PARAMEXPNEST_MAX)
|
|
||||||
+ dbstate[nesting_level] = dolbrace_state;
|
|
||||||
nesting_level++;
|
|
||||||
i += 2;
|
|
||||||
if (dolbrace_state == DOLBRACE_QUOTE || dolbrace_state == DOLBRACE_WORD)
|
|
||||||
@@ -1864,6 +1871,7 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
|
||||||
nesting_level--;
|
|
||||||
if (nesting_level == 0)
|
|
||||||
break;
|
|
||||||
+ dolbrace_state = (nesting_level < PARAMEXPNEST_MAX) ? dbstate[nesting_level] : dbstate[0]; /* Guess using initial state */
|
|
||||||
i++;
|
|
||||||
continue;
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 4
|
|
||||||
+#define PATCHLEVEL 5
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -8965,7 +8965,8 @@ pat_subst (string, pat, rep, mflags)
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
else if (*string == 0 && (match_pattern (string, pat, mtype, &s, &e) != 0))
|
|
||||||
- return ((mflags & MATCH_EXPREP) ? strcreplace (rep, '&', "", 2) : savestring (rep));
|
|
||||||
+ return (mflags & MATCH_EXPREP) ? strcreplace (rep, '&', "", 2)
|
|
||||||
+ : (rep ? savestring (rep) : savestring (""));
|
|
||||||
|
|
||||||
ret = (char *)xmalloc (rsize = 64);
|
|
||||||
ret[0] = '\0';
|
|
@ -1,230 +0,0 @@
|
|||||||
diff --git a/builtins/common.h b/builtins/common.h
|
|
||||||
--- a/builtins/common.h
|
|
||||||
+++ b/builtins/common.h
|
|
||||||
@@ -257,6 +257,8 @@ extern int print_shift_error;
|
|
||||||
extern int expand_once_flag;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+extern int expaliases_flag;
|
|
||||||
+
|
|
||||||
/* variables from source.def */
|
|
||||||
extern int source_searches_cwd;
|
|
||||||
extern int source_uses_path;
|
|
||||||
diff --git a/builtins/shopt.def b/builtins/shopt.def
|
|
||||||
--- a/builtins/shopt.def
|
|
||||||
+++ b/builtins/shopt.def
|
|
||||||
@@ -149,6 +149,9 @@ static int shopt_set_complete_direxpand PARAMS((char *, int));
|
|
||||||
static int set_assoc_expand PARAMS((char *, int));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+int expaliases_flag = 0;
|
|
||||||
+static int shopt_set_expaliases PARAMS((char *, int));
|
|
||||||
+
|
|
||||||
static int shopt_set_debug_mode PARAMS((char *, int));
|
|
||||||
|
|
||||||
static int shopt_login_shell;
|
|
||||||
@@ -198,7 +201,7 @@ static struct {
|
|
||||||
#endif
|
|
||||||
{ "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL },
|
|
||||||
{ "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL },
|
|
||||||
- { "expand_aliases", &expand_aliases, (shopt_set_func_t *)NULL },
|
|
||||||
+ { "expand_aliases", &expaliases_flag, shopt_set_expaliases },
|
|
||||||
#if defined (DEBUGGER)
|
|
||||||
{ "extdebug", &debugging_mode, shopt_set_debug_mode },
|
|
||||||
#endif
|
|
||||||
@@ -350,7 +353,7 @@ reset_shopt_options ()
|
|
||||||
check_window_size = CHECKWINSIZE_DEFAULT;
|
|
||||||
allow_null_glob_expansion = glob_dot_filenames = 0;
|
|
||||||
no_exit_on_failed_exec = 0;
|
|
||||||
- expand_aliases = 0;
|
|
||||||
+ expand_aliases = expaliases_flag = 0;
|
|
||||||
extended_quote = 1;
|
|
||||||
fail_glob_expansion = 0;
|
|
||||||
glob_asciirange = GLOBASCII_DEFAULT;
|
|
||||||
@@ -631,6 +634,15 @@ shopt_set_debug_mode (option_name, mode)
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int
|
|
||||||
+shopt_set_expaliases (option_name, mode)
|
|
||||||
+ char *option_name;
|
|
||||||
+ int mode;
|
|
||||||
+{
|
|
||||||
+ expand_aliases = expaliases_flag;
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#if defined (READLINE)
|
|
||||||
static int
|
|
||||||
shopt_enable_hostname_completion (option_name, mode)
|
|
||||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
|
||||||
--- a/execute_cmd.c
|
|
||||||
+++ b/execute_cmd.c
|
|
||||||
@@ -1536,7 +1536,7 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
|
||||||
expansion with `shopt -s expand_alias' to continue to expand
|
|
||||||
aliases. */
|
|
||||||
if (ois != interactive_shell)
|
|
||||||
- expand_aliases = 0;
|
|
||||||
+ expand_aliases = expaliases_flag = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Subshells are neither login nor interactive. */
|
|
||||||
diff --git a/general.c b/general.c
|
|
||||||
--- a/general.c
|
|
||||||
+++ b/general.c
|
|
||||||
@@ -91,7 +91,7 @@ static struct {
|
|
||||||
{
|
|
||||||
&interactive_comments,
|
|
||||||
&source_uses_path,
|
|
||||||
- &expand_aliases,
|
|
||||||
+ &expaliases_flag,
|
|
||||||
&inherit_errexit,
|
|
||||||
&print_shift_error,
|
|
||||||
0
|
|
||||||
@@ -106,7 +106,8 @@ posix_initialize (on)
|
|
||||||
/* Things that should be turned on when posix mode is enabled. */
|
|
||||||
if (on != 0)
|
|
||||||
{
|
|
||||||
- interactive_comments = source_uses_path = expand_aliases = 1;
|
|
||||||
+ interactive_comments = source_uses_path = 1;
|
|
||||||
+ expand_aliases = expaliases_flag = 1;
|
|
||||||
inherit_errexit = 1;
|
|
||||||
source_searches_cwd = 0;
|
|
||||||
print_shift_error = 1;
|
|
||||||
@@ -116,13 +117,14 @@ posix_initialize (on)
|
|
||||||
else if (saved_posix_vars) /* on == 0, restore saved settings */
|
|
||||||
{
|
|
||||||
set_posix_options (saved_posix_vars);
|
|
||||||
+ expand_aliases = expaliases_flag;
|
|
||||||
free (saved_posix_vars);
|
|
||||||
saved_posix_vars = 0;
|
|
||||||
}
|
|
||||||
else /* on == 0, restore a default set of settings */
|
|
||||||
{
|
|
||||||
source_searches_cwd = 1;
|
|
||||||
- expand_aliases = interactive_shell;
|
|
||||||
+ expand_aliases = expaliases_flag = interactive_shell; /* XXX */
|
|
||||||
print_shift_error = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/parse.y b/parse.y
|
|
||||||
--- a/parse.y
|
|
||||||
+++ b/parse.y
|
|
||||||
@@ -3306,6 +3306,8 @@ reset_parser ()
|
|
||||||
if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
|
|
||||||
extended_glob = global_extglob;
|
|
||||||
#endif
|
|
||||||
+ if (parser_state & (PST_CMDSUBST|PST_STRING))
|
|
||||||
+ expand_aliases = expaliases_flag;
|
|
||||||
|
|
||||||
parser_state = 0;
|
|
||||||
here_doc_first_line = 0;
|
|
||||||
@@ -4388,6 +4390,7 @@ parse_string_to_command (string, flags)
|
|
||||||
if (flags & SX_COMPLETE)
|
|
||||||
parser_state |= PST_NOERROR;
|
|
||||||
|
|
||||||
+ parser_state |= PST_STRING;
|
|
||||||
expand_aliases = 0;
|
|
||||||
|
|
||||||
cmd = 0;
|
|
||||||
@@ -6401,7 +6404,7 @@ parse_string_to_word_list (s, flags, whom)
|
|
||||||
/* State flags we don't want to persist into compound assignments. */
|
|
||||||
parser_state &= ~PST_NOEXPAND; /* parse_comsub sentinel */
|
|
||||||
/* State flags we want to set for this run through the tokenizer. */
|
|
||||||
- parser_state |= PST_COMPASSIGN|PST_REPARSE;
|
|
||||||
+ parser_state |= PST_COMPASSIGN|PST_REPARSE|PST_STRING;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((tok = read_token (READ)) != yacc_EOF)
|
|
||||||
diff --git a/parser.h b/parser.h
|
|
||||||
--- a/parser.h
|
|
||||||
+++ b/parser.h
|
|
||||||
@@ -50,6 +50,7 @@
|
|
||||||
#define PST_ENDALIAS 0x200000 /* just finished expanding and consuming an alias */
|
|
||||||
#define PST_NOEXPAND 0x400000 /* don't expand anything in read_token_word; for command substitution */
|
|
||||||
#define PST_NOERROR 0x800000 /* don't print error messages in yyerror */
|
|
||||||
+#define PST_STRING 0x1000000 /* parsing a string to a command or word list */
|
|
||||||
|
|
||||||
/* Definition of the delimiter stack. Needed by parse.y and bashhist.c. */
|
|
||||||
struct dstack {
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 5
|
|
||||||
+#define PATCHLEVEL 6
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/shell.c b/shell.c
|
|
||||||
--- a/shell.c
|
|
||||||
+++ b/shell.c
|
|
||||||
@@ -1844,8 +1844,8 @@ reset_option_defaults ()
|
|
||||||
static void
|
|
||||||
init_interactive ()
|
|
||||||
{
|
|
||||||
- expand_aliases = interactive_shell = startup_state = 1;
|
|
||||||
- interactive = 1;
|
|
||||||
+ expand_aliases = expaliases_flag = 1;
|
|
||||||
+ interactive_shell = startup_state = interactive = 1;
|
|
||||||
#if defined (HISTORY)
|
|
||||||
if (enable_history_list == -1)
|
|
||||||
enable_history_list = 1; /* set default */
|
|
||||||
@@ -1865,7 +1865,7 @@ init_noninteractive ()
|
|
||||||
bash_history_reinit (0);
|
|
||||||
#endif /* HISTORY */
|
|
||||||
interactive_shell = startup_state = interactive = 0;
|
|
||||||
- expand_aliases = posixly_correct; /* XXX - was 0 not posixly_correct */
|
|
||||||
+ expand_aliases = expaliases_flag = posixly_correct; /* XXX - was 0 not posixly_correct */
|
|
||||||
no_line_editing = 1;
|
|
||||||
#if defined (JOB_CONTROL)
|
|
||||||
/* Even if the shell is not interactive, enable job control if the -i or
|
|
||||||
@@ -1882,7 +1882,7 @@ init_interactive_script ()
|
|
||||||
enable_history_list = 1;
|
|
||||||
#endif
|
|
||||||
init_noninteractive ();
|
|
||||||
- expand_aliases = interactive_shell = startup_state = 1;
|
|
||||||
+ expand_aliases = expaliases_flag = interactive_shell = startup_state = 1;
|
|
||||||
#if defined (HISTORY)
|
|
||||||
remember_on_history = enable_history_list; /* XXX */
|
|
||||||
#endif
|
|
||||||
@@ -2025,7 +2025,7 @@ shell_reinitialize ()
|
|
||||||
debugging = do_version = line_number = last_command_exit_value = 0;
|
|
||||||
forced_interactive = interactive_shell = 0;
|
|
||||||
subshell_environment = running_in_background = 0;
|
|
||||||
- expand_aliases = 0;
|
|
||||||
+ expand_aliases = expaliases_flag = 0;
|
|
||||||
bash_argv_initialized = 0;
|
|
||||||
|
|
||||||
/* XXX - should we set jobs_m_flag to 0 here? */
|
|
||||||
diff --git a/y.tab.c b/y.tab.c
|
|
||||||
--- a/y.tab.c
|
|
||||||
+++ b/y.tab.c
|
|
||||||
@@ -5617,6 +5617,8 @@ reset_parser ()
|
|
||||||
if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
|
|
||||||
extended_glob = global_extglob;
|
|
||||||
#endif
|
|
||||||
+ if (parser_state & (PST_CMDSUBST|PST_STRING))
|
|
||||||
+ expand_aliases = expaliases_flag;
|
|
||||||
|
|
||||||
parser_state = 0;
|
|
||||||
here_doc_first_line = 0;
|
|
||||||
@@ -6699,6 +6701,7 @@ parse_string_to_command (string, flags)
|
|
||||||
if (flags & SX_COMPLETE)
|
|
||||||
parser_state |= PST_NOERROR;
|
|
||||||
|
|
||||||
+ parser_state |= PST_STRING;
|
|
||||||
expand_aliases = 0;
|
|
||||||
|
|
||||||
cmd = 0;
|
|
||||||
@@ -8712,7 +8715,7 @@ parse_string_to_word_list (s, flags, whom)
|
|
||||||
/* State flags we don't want to persist into compound assignments. */
|
|
||||||
parser_state &= ~PST_NOEXPAND; /* parse_comsub sentinel */
|
|
||||||
/* State flags we want to set for this run through the tokenizer. */
|
|
||||||
- parser_state |= PST_COMPASSIGN|PST_REPARSE;
|
|
||||||
+ parser_state |= PST_COMPASSIGN|PST_REPARSE|PST_STRING;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((tok = read_token (READ)) != yacc_EOF)
|
|
@ -1,206 +0,0 @@
|
|||||||
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
|
|
||||||
--- a/builtins/evalstring.c
|
|
||||||
+++ b/builtins/evalstring.c
|
|
||||||
@@ -431,6 +431,8 @@ parse_and_execute (string, from_file, flags)
|
|
||||||
|
|
||||||
if (parse_command () == 0)
|
|
||||||
{
|
|
||||||
+ int local_expalias, local_alflag;
|
|
||||||
+
|
|
||||||
if ((flags & SEVAL_PARSEONLY) || (interactive_shell == 0 && read_but_dont_execute))
|
|
||||||
{
|
|
||||||
last_result = EXECUTION_SUCCESS;
|
|
||||||
@@ -507,6 +509,19 @@ parse_and_execute (string, from_file, flags)
|
|
||||||
}
|
|
||||||
#endif /* ONESHOT */
|
|
||||||
|
|
||||||
+ /* We play tricks in the parser and command_substitute() turning
|
|
||||||
+ expand_aliases on and off depending on which parsing pass and
|
|
||||||
+ whether or not we're in posix mode. This only matters for
|
|
||||||
+ parsing, and we let the higher layers deal with that. We just
|
|
||||||
+ want to ensure that expand_aliases is set to the appropriate
|
|
||||||
+ global value when we go to execute this command, so we save
|
|
||||||
+ and restore it around the execution (we don't restore it if
|
|
||||||
+ the global value of the flag (expaliases_flag) changes). */
|
|
||||||
+ local_expalias = expand_aliases;
|
|
||||||
+ local_alflag = expaliases_flag;
|
|
||||||
+ if (subshell_environment & SUBSHELL_COMSUB)
|
|
||||||
+ expand_aliases = expaliases_flag;
|
|
||||||
+
|
|
||||||
/* See if this is a candidate for $( <file ). */
|
|
||||||
if (startup_state == 2 &&
|
|
||||||
(subshell_environment & SUBSHELL_COMSUB) &&
|
|
||||||
@@ -524,6 +539,10 @@ parse_and_execute (string, from_file, flags)
|
|
||||||
dispose_fd_bitmap (bitmap);
|
|
||||||
discard_unwind_frame ("pe_dispose");
|
|
||||||
|
|
||||||
+ /* If the global value didn't change, we restore what we had. */
|
|
||||||
+ if ((subshell_environment & SUBSHELL_COMSUB) && local_alflag == expaliases_flag)
|
|
||||||
+ expand_aliases = local_expalias;
|
|
||||||
+
|
|
||||||
if (flags & SEVAL_ONECMD)
|
|
||||||
{
|
|
||||||
reset_parser ();
|
|
||||||
diff --git a/command.h b/command.h
|
|
||||||
--- a/command.h
|
|
||||||
+++ b/command.h
|
|
||||||
@@ -114,6 +114,7 @@ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select,
|
|
||||||
#define PF_COMPLETE 0x10 /* same as W_COMPLETE, sets SX_COMPLETE */
|
|
||||||
#define PF_EXPANDRHS 0x20 /* same as W_EXPANDRHS */
|
|
||||||
#define PF_ALLINDS 0x40 /* array, act as if [@] was supplied */
|
|
||||||
+#define PF_BACKQUOTE 0x80 /* differentiate `` from $() for command_substitute */
|
|
||||||
|
|
||||||
/* Possible values for subshell_environment */
|
|
||||||
#define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */
|
|
||||||
diff --git a/parse.y b/parse.y
|
|
||||||
--- a/parse.y
|
|
||||||
+++ b/parse.y
|
|
||||||
@@ -3612,6 +3612,7 @@ tokword:
|
|
||||||
#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */
|
|
||||||
#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */
|
|
||||||
#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */
|
|
||||||
+#define P_ARITH 0x0080 /* parsing a $(( )) arithmetic expansion */
|
|
||||||
|
|
||||||
/* Lexical state while parsing a grouping construct or $(...). */
|
|
||||||
#define LEX_WASDOL 0x0001
|
|
||||||
@@ -3910,6 +3911,9 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
|
||||||
}
|
|
||||||
else if ((flags & (P_ARRAYSUB|P_DOLBRACE)) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */
|
|
||||||
goto parse_dollar_word;
|
|
||||||
+ else if ((flags & P_ARITH) && (tflags & LEX_WASDOL) && ch == '(') /*)*/
|
|
||||||
+ /* $() inside $(( ))/$[ ] */
|
|
||||||
+ goto parse_dollar_word;
|
|
||||||
#if defined (PROCESS_SUBSTITUTION)
|
|
||||||
/* XXX - technically this should only be recognized at the start of
|
|
||||||
a word */
|
|
||||||
@@ -3940,7 +3944,7 @@ parse_dollar_word:
|
|
||||||
else if (ch == '{') /* } */
|
|
||||||
nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags);
|
|
||||||
else if (ch == '[') /* ] */
|
|
||||||
- nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags);
|
|
||||||
+ nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags|P_ARITH);
|
|
||||||
|
|
||||||
CHECK_NESTRET_ERROR ();
|
|
||||||
APPEND_NESTRET ();
|
|
||||||
@@ -4079,7 +4083,7 @@ parse_comsub (qc, open, close, lenp, flags)
|
|
||||||
peekc = shell_getc (1);
|
|
||||||
shell_ungetc (peekc);
|
|
||||||
if (peekc == '(') /*)*/
|
|
||||||
- return (parse_matched_pair (qc, open, close, lenp, 0));
|
|
||||||
+ return (parse_matched_pair (qc, open, close, lenp, P_ARITH));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/
|
|
||||||
@@ -4500,7 +4504,7 @@ parse_arith_cmd (ep, adddq)
|
|
||||||
int ttoklen;
|
|
||||||
|
|
||||||
exp_lineno = line_number;
|
|
||||||
- ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0);
|
|
||||||
+ ttok = parse_matched_pair (0, '(', ')', &ttoklen, P_ARITH);
|
|
||||||
rval = 1;
|
|
||||||
if (ttok == &matched_pair_error)
|
|
||||||
return -1;
|
|
||||||
@@ -5015,7 +5019,7 @@ read_token_word (character)
|
|
||||||
pop_delimiter (dstack);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
- ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0);
|
|
||||||
+ ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARITH);
|
|
||||||
if (ttok == &matched_pair_error)
|
|
||||||
return -1; /* Bail immediately. */
|
|
||||||
RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3,
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 6
|
|
||||||
+#define PATCHLEVEL 7
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -7123,8 +7123,12 @@ command_substitute (string, quoted, flags)
|
|
||||||
remove_quoted_escapes (string);
|
|
||||||
|
|
||||||
/* We want to expand aliases on this pass if we are not in posix mode
|
|
||||||
- for backwards compatibility. */
|
|
||||||
- if (expand_aliases)
|
|
||||||
+ for backwards compatibility. parse_and_execute() takes care of
|
|
||||||
+ setting expand_aliases back to the global value when executing the
|
|
||||||
+ parsed string. We only do this for $(...) command substitution,
|
|
||||||
+ since that is what parse_comsub handles; `` comsubs are processed
|
|
||||||
+ using parse.y:parse_matched_pair(). */
|
|
||||||
+ if (expand_aliases && (flags & PF_BACKQUOTE) == 0)
|
|
||||||
expand_aliases = posixly_correct == 0;
|
|
||||||
|
|
||||||
startup_state = 2; /* see if we can avoid a fork */
|
|
||||||
@@ -11292,7 +11296,7 @@ add_string:
|
|
||||||
else
|
|
||||||
{
|
|
||||||
de_backslash (temp);
|
|
||||||
- tword = command_substitute (temp, quoted, 0);
|
|
||||||
+ tword = command_substitute (temp, quoted, PF_BACKQUOTE);
|
|
||||||
temp1 = tword ? tword->word : (char *)NULL;
|
|
||||||
if (tword)
|
|
||||||
dispose_word_desc (tword);
|
|
||||||
diff --git a/y.tab.c b/y.tab.c
|
|
||||||
--- a/y.tab.c
|
|
||||||
+++ b/y.tab.c
|
|
||||||
@@ -5923,6 +5923,7 @@ tokword:
|
|
||||||
#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */
|
|
||||||
#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */
|
|
||||||
#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */
|
|
||||||
+#define P_ARITH 0x0080 /* parsing a $(( )) arithmetic expansion */
|
|
||||||
|
|
||||||
/* Lexical state while parsing a grouping construct or $(...). */
|
|
||||||
#define LEX_WASDOL 0x0001
|
|
||||||
@@ -6221,6 +6222,9 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
|
||||||
}
|
|
||||||
else if ((flags & (P_ARRAYSUB|P_DOLBRACE)) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */
|
|
||||||
goto parse_dollar_word;
|
|
||||||
+ else if ((flags & P_ARITH) && (tflags & LEX_WASDOL) && ch == '(') /*)*/
|
|
||||||
+ /* $() inside $(( ))/$[ ] */
|
|
||||||
+ goto parse_dollar_word;
|
|
||||||
#if defined (PROCESS_SUBSTITUTION)
|
|
||||||
/* XXX - technically this should only be recognized at the start of
|
|
||||||
a word */
|
|
||||||
@@ -6251,7 +6255,7 @@ parse_dollar_word:
|
|
||||||
else if (ch == '{') /* } */
|
|
||||||
nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags);
|
|
||||||
else if (ch == '[') /* ] */
|
|
||||||
- nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags);
|
|
||||||
+ nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags|P_ARITH);
|
|
||||||
|
|
||||||
CHECK_NESTRET_ERROR ();
|
|
||||||
APPEND_NESTRET ();
|
|
||||||
@@ -6390,7 +6394,7 @@ parse_comsub (qc, open, close, lenp, flags)
|
|
||||||
peekc = shell_getc (1);
|
|
||||||
shell_ungetc (peekc);
|
|
||||||
if (peekc == '(') /*)*/
|
|
||||||
- return (parse_matched_pair (qc, open, close, lenp, 0));
|
|
||||||
+ return (parse_matched_pair (qc, open, close, lenp, P_ARITH));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/
|
|
||||||
@@ -6811,7 +6815,7 @@ parse_arith_cmd (ep, adddq)
|
|
||||||
int ttoklen;
|
|
||||||
|
|
||||||
exp_lineno = line_number;
|
|
||||||
- ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0);
|
|
||||||
+ ttok = parse_matched_pair (0, '(', ')', &ttoklen, P_ARITH);
|
|
||||||
rval = 1;
|
|
||||||
if (ttok == &matched_pair_error)
|
|
||||||
return -1;
|
|
||||||
@@ -7326,7 +7330,7 @@ read_token_word (character)
|
|
||||||
pop_delimiter (dstack);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
- ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0);
|
|
||||||
+ ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARITH);
|
|
||||||
if (ttok == &matched_pair_error)
|
|
||||||
return -1; /* Bail immediately. */
|
|
||||||
RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3,
|
|
@ -1,34 +0,0 @@
|
|||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 7
|
|
||||||
+#define PATCHLEVEL 8
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
||||||
diff --git a/subst.c b/subst.c
|
|
||||||
--- a/subst.c
|
|
||||||
+++ b/subst.c
|
|
||||||
@@ -3819,6 +3819,10 @@ pos_params (string, start, end, quoted, pflags)
|
|
||||||
#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~')
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+/* We don't perform process substitution in arithmetic expressions, so don't
|
|
||||||
+ bother checking for it. */
|
|
||||||
+#define ARITH_EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~')
|
|
||||||
+
|
|
||||||
/* If there are any characters in STRING that require full expansion,
|
|
||||||
then call FUNC to expand STRING; otherwise just perform quote
|
|
||||||
removal if necessary. This returns a new string. */
|
|
||||||
@@ -4028,7 +4032,7 @@ expand_arith_string (string, quoted)
|
|
||||||
i = saw_quote = 0;
|
|
||||||
while (string[i])
|
|
||||||
{
|
|
||||||
- if (EXP_CHAR (string[i]))
|
|
||||||
+ if (ARITH_EXP_CHAR (string[i]))
|
|
||||||
break;
|
|
||||||
else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"')
|
|
||||||
saw_quote = string[i];
|
|
@ -1,23 +0,0 @@
|
|||||||
diff --git a/expr.c b/expr.c
|
|
||||||
--- a/expr.c
|
|
||||||
+++ b/expr.c
|
|
||||||
@@ -1168,6 +1168,8 @@ expr_streval (tok, e, lvalue)
|
|
||||||
/* [[[[[ */
|
|
||||||
#if defined (ARRAY_VARS)
|
|
||||||
aflag = tflag; /* use a different variable for now */
|
|
||||||
+ if (shell_compatibility_level > 51)
|
|
||||||
+ aflag |= AV_ATSTARKEYS;
|
|
||||||
v = (e == ']') ? array_variable_part (tok, tflag, (char **)0, (int *)0) : find_variable (tok);
|
|
||||||
#else
|
|
||||||
v = find_variable (tok);
|
|
||||||
diff --git a/patchlevel.h b/patchlevel.h
|
|
||||||
--- a/patchlevel.h
|
|
||||||
+++ b/patchlevel.h
|
|
||||||
@@ -25,6 +25,6 @@
|
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
||||||
looks for to find the patch level (for the sccs version string). */
|
|
||||||
|
|
||||||
-#define PATCHLEVEL 8
|
|
||||||
+#define PATCHLEVEL 9
|
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
|
@ -0,0 +1,15 @@
|
|||||||
|
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||||
|
--- a/execute_cmd.c
|
||||||
|
+++ b/execute_cmd.c
|
||||||
|
@@ -5496,11 +5496,7 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
|
||||||
|
{
|
||||||
|
/* If we're optimizing out the fork (implicit `exec'), decrement the
|
||||||
|
shell level like `exec' would do. */
|
||||||
|
-#if 0 /* TAG: bash-5.2 psmith 10/11/2020 */
|
||||||
|
if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && (subshell_environment & SUBSHELL_PIPE) == 0)
|
||||||
|
-#else
|
||||||
|
- if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE)
|
||||||
|
-#endif
|
||||||
|
adjust_shell_level (-1);
|
||||||
|
|
||||||
|
maybe_make_export_env ();
|
@ -1,20 +0,0 @@
|
|||||||
Another C compatibility issue: char ** and char * are distinct types,
|
|
||||||
and strtold expects the former for its second argument.
|
|
||||||
|
|
||||||
Submitted upstream:
|
|
||||||
|
|
||||||
<https://lists.gnu.org/archive/html/bug-bash/2023-11/msg00104.html>
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 6defea0835fe8877..955c1149a8141e19 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -885,7 +885,7 @@ AC_CHECK_DECLS([strtold], [
|
|
||||||
[AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
|
||||||
[[#include <stdlib.h>]],
|
|
||||||
- [[long double r; char *foo, bar; r = strtold(foo, &bar);]]
|
|
||||||
+ [[long double r; char *foo, *bar; r = strtold(foo, &bar);]]
|
|
||||||
)],
|
|
||||||
[bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
|
|
||||||
]
|
|
@ -1,21 +0,0 @@
|
|||||||
Avoid an implicit declaration of dup2 in its configure probe. This
|
|
||||||
prevents build issues with future compilers.
|
|
||||||
|
|
||||||
Already reported upstream:
|
|
||||||
|
|
||||||
<https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00000.html>
|
|
||||||
|
|
||||||
diff --git a/aclocal.m4 b/aclocal.m4
|
|
||||||
index 6162f6eb9ef90754..5cbbe96d7158197a 100644
|
|
||||||
--- a/aclocal.m4
|
|
||||||
+++ b/aclocal.m4
|
|
||||||
@@ -238,6 +238,9 @@ AC_CACHE_VAL(bash_cv_dup2_broken,
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
+#ifdef HAVE_UNISTD_H
|
|
||||||
+# include <unistd.h>
|
|
||||||
+#endif /* HAVE_UNISTD_H */
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/doc/Makefile.in b/doc/Makefile.in
|
||||||
|
index 5f0756c..a5fa5a0 100644
|
||||||
|
--- a/doc/Makefile.in
|
||||||
|
+++ b/doc/Makefile.in
|
||||||
|
@@ -74,7 +74,6 @@ TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi
|
||||||
|
TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html
|
||||||
|
MAN2HTML = ${BUILD_DIR}/support/man2html
|
||||||
|
HTMLPOST = ${srcdir}/htmlpost.sh
|
||||||
|
-INFOPOST = ${srcdir}/infopost.sh
|
||||||
|
QUIETPS = #set this to -q to shut up dvips
|
||||||
|
PAPERSIZE = letter # change to a4 for A4-size paper
|
||||||
|
PSDPI = 600 # could be 300 if you like
|
||||||
|
@@ -188,8 +187,8 @@ bashref.pdf: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
|
||||||
|
bashref.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
|
||||||
|
$(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
|
||||||
|
|
||||||
|
-bash.info: bashref.info
|
||||||
|
- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
|
||||||
|
+bash.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
|
||||||
|
+ $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi -o $@
|
||||||
|
|
||||||
|
bash.txt: bash.1
|
||||||
|
bash.ps: bash.1
|
||||||
|
--
|
||||||
|
2.9.3
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
||||||
Version: GnuPG v1.2.4 (Darwin)
|
|
||||||
|
|
||||||
mQGiBEEOsGwRBACFa0A1oa71HSZLWxAx0svXzhOZNQZOzqHmSuGOG92jIpQpr8Dp
|
|
||||||
vgRh40YpAwdcXb8QG1J5yGAKeevNE1zCFaA725vGSdHUyypHouV0xoWwukYO6qly
|
|
||||||
yX+2BZU+okBUqoWQkoWxiYaCSfzB2Ln7pmdys1fJhcgBKf3VjWCjd2XJTwCgoFJO
|
|
||||||
wyBFJdugjfwjSoRSwDOIMf0D/iQKqlWhIO1LGpMrGX0il0/x4zj0NAcSwAk7LaPZ
|
|
||||||
bN4UPjn5pqGEHBlf1+xDDQCkAoZ/VqESGZragl4VqJfxBr29Ag0UDvNbUbXoxQsA
|
|
||||||
Rdero1M8GiAIRc50hj7HXFoERwenbNDJL86GPLAQOTGOCa4W2o29nFfFjQrsrrYH
|
|
||||||
zVtyA/9oyKvTeEMJ7NA3VJdWcmn7gOu0FxEmSNhSoV1T4vP21Wf7f5niCCRKQLNy
|
|
||||||
Uy0wEApQi4tSysdz+AbgAc0b/bHYVzIf2uO2lIEZQNNt+3g2bmXgloWmW5fsm/di
|
|
||||||
50Gm1l1Na63d3RZ00SeFQos6WEwLUHEB0yp6KXluXLLIZitEJLQaQ2hldCBSYW1l
|
|
||||||
eSA8Y2hldEBjd3J1LmVkdT6IXgQTEQIAHgUCQQ6wbAIbAwYLCQgHAwIDFQIDAxYC
|
|
||||||
AQIeAQIXgAAKCRC7WGnwZOp0q87NAJ99FEzFvDdYzqCczXF6KKXi7YN5OACfacDY
|
|
||||||
soZcnnsy7EjBZL0zwGwb/sG5AQ0EQQ6wbxAEAJCukwDigRDPhAuI+lf+6P64lWan
|
|
||||||
IFOXIndqhvU13cDbQ/Wt5LwPzm2QTvd7F+fcHOgZ8KOFScbDpjJaRqwIybMTcIN0
|
|
||||||
B2pBLX/C10W1aY+cUrXZgXUGVISEMmpaP9v02auToo7XXVEHC+XLO9IU7/xaU98F
|
|
||||||
L69l6/K4xeNSBRM/AAMHA/wNAmRBpcyK0+VggZ5esQaIP/LyolAm2qwcmrd3dZi+
|
|
||||||
g24s7yjV0EUwvRP7xHRDQFgkAo6++QbuecU/J90lxrVnQwucZmfz9zgWDkT/MpfB
|
|
||||||
/CNRSKLFjhYq2yHmHWT6vEjw9Ry/hF6Pc0oh1a62USdfaKAiim0nVxxQmPmiRvtC
|
|
||||||
mYhJBBgRAgAJBQJBDrBvAhsMAAoJELtYafBk6nSr43AAn2ZZFQg8Gs/zUzvXMt7e
|
|
||||||
vaFqVTzcAJ0cHtKpP1i/4H4R9+OsYeQdxxWxTQ==
|
|
||||||
=2MjR
|
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
Loading…
Reference in new issue