]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.1 patch 3: fix command substitution in here-document from child process in...
authorChet Ramey <chet.ramey@case.edu>
Sat, 19 Dec 2020 19:29:01 +0000 (14:29 -0500)
committerChet Ramey <chet.ramey@case.edu>
Sat, 19 Dec 2020 19:29:01 +0000 (14:29 -0500)
patchlevel.h
subst.c

index 8a1835518c8aca5fd2ccfef13668776f4516e015..e4d85cf8b5c232793fb9255ad7c74a0f289fe6b8 100644 (file)
@@ -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
index 9ccbf3366d5c58cbb56ec8ad913c872c7f31ccc5..23f847f41625ac430d143a10b529973002615869 100644 (file)
--- 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 */