3fb13f
From 280bd77d8d3e7f7c90c9fa07de3d1e8f8e18ac29 Mon Sep 17 00:00:00 2001
3fb13f
From: Chet Ramey <chet.ramey@case.edu>
3fb13f
Date: Mon, 14 Nov 2016 14:27:06 -0500
3fb13f
Subject: [PATCH] Bash-4.4 patch 2
3fb13f
3fb13f
---
3fb13f
 patchlevel.h | 2 +-
3fb13f
 subst.c      | 9 ++++++++-
3fb13f
 2 files changed, 9 insertions(+), 2 deletions(-)
3fb13f
3fb13f
diff --git a/patchlevel.h b/patchlevel.h
3fb13f
index 40db1a3..a988d85 100644
3fb13f
--- a/patchlevel.h
3fb13f
+++ b/patchlevel.h
3fb13f
@@ -25,6 +25,6 @@
3fb13f
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
3fb13f
    looks for to find the patch level (for the sccs version string). */
3fb13f
 
3fb13f
-#define PATCHLEVEL 1
3fb13f
+#define PATCHLEVEL 2
3fb13f
 
3fb13f
 #endif /* _PATCHLEVEL_H_ */
3fb13f
diff --git a/subst.c b/subst.c
3fb13f
index f1a4df1..4d498ef 100644
3fb13f
--- a/subst.c
3fb13f
+++ b/subst.c
3fb13f
@@ -5931,6 +5931,7 @@ read_comsub (fd, quoted, rflag)
3fb13f
   char *istring, buf[128], *bufp, *s;
3fb13f
   int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul;
3fb13f
   ssize_t bufn;
3fb13f
+  int nullbyte;
3fb13f
 
3fb13f
   istring = (char *)NULL;
3fb13f
   istring_index = istring_size = bufn = tflag = 0;
3fb13f
@@ -5938,6 +5939,8 @@ read_comsub (fd, quoted, rflag)
3fb13f
   for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++)
3fb13f
     skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL;
3fb13f
 
3fb13f
+  nullbyte = 0;
3fb13f
+
3fb13f
   /* Read the output of the command through the pipe.  This may need to be
3fb13f
      changed to understand multibyte characters in the future. */
3fb13f
   while (1)
3fb13f
@@ -5956,7 +5959,11 @@ read_comsub (fd, quoted, rflag)
3fb13f
       if (c == 0)
3fb13f
 	{
3fb13f
 #if 1
3fb13f
-	  internal_warning ("%s", _("command substitution: ignored null byte in input"));
3fb13f
+	  if (nullbyte == 0)
3fb13f
+	    {
3fb13f
+	      internal_warning ("%s", _("command substitution: ignored null byte in input"));
3fb13f
+	      nullbyte = 1;
3fb13f
+	    }
3fb13f
 #endif
3fb13f
 	  continue;
3fb13f
 	}
3fb13f
-- 
3fb13f
2.9.3
3fb13f