summaryrefslogtreecommitdiff
path: root/app-shells/bash/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-09 01:31:00 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-09 01:31:00 +0100
commitc956c264bdc853972b72016b752683468881af25 (patch)
treed6305ce3422074c4aaf3159ddd7a23bba7682e45 /app-shells/bash/files
parent541eca7cf7b9950f0adaaf9158f94c76ba0aedc9 (diff)
gentoo auto-resync : 09:10:2022 - 01:31:00
Diffstat (limited to 'app-shells/bash/files')
-rw-r--r--app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch41
-rw-r--r--app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch38
2 files changed, 41 insertions, 38 deletions
diff --git a/app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch b/app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch
new file mode 100644
index 000000000000..9c1b03f8b2df
--- /dev/null
+++ b/app-shells/bash/files/bash-5.2_p2-fix-for-brackets-in-nested-parameter-expansions.patch
@@ -0,0 +1,41 @@
+https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=22f21b760ed90eb77c3756e6ccf39b73c84f532a
+
+--- subst.c
++++ 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;
+ }
+
diff --git a/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch b/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch
index 06415b5cdaa4..16393c79af8b 100644
--- a/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch
+++ b/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch
@@ -213,44 +213,6 @@ https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=22f21b760ed90eb77c
This file is part of GNU Bash, the Bourne Again SHell.
---- subst.c
-+++ 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;
- }
--- tests/extglob.right
+++ tests/extglob.right
@@ -182,3 +182,10 @@ no dotglob: .a .foo bar