50ece2
From b9f81c2977b82490cd4dc70b0bb292bfbf86bd2c Mon Sep 17 00:00:00 2001
50ece2
From: Chet Ramey <chet.ramey@case.edu>
50ece2
Date: Fri, 20 Jan 2017 15:38:10 -0500
50ece2
Subject: [PATCH] Bash-4.4 patch 8
50ece2
50ece2
---
50ece2
 expr.c       | 15 +++++++++------
50ece2
 patchlevel.h |  2 +-
50ece2
 2 files changed, 10 insertions(+), 7 deletions(-)
50ece2
50ece2
diff --git a/expr.c b/expr.c
50ece2
index 1ddb693..172964a 100644
50ece2
--- a/expr.c
50ece2
+++ b/expr.c
50ece2
@@ -578,24 +578,23 @@ expcond ()
50ece2
   rval = cval = explor ();
50ece2
   if (curtok == QUES)		/* found conditional expr */
50ece2
     {
50ece2
-      readtok ();
50ece2
-      if (curtok == 0 || curtok == COL)
50ece2
-	evalerror (_("expression expected"));
50ece2
       if (cval == 0)
50ece2
 	{
50ece2
 	  set_noeval = 1;
50ece2
 	  noeval++;
50ece2
 	}
50ece2
 
50ece2
+      readtok ();
50ece2
+      if (curtok == 0 || curtok == COL)
50ece2
+	evalerror (_("expression expected"));
50ece2
+
50ece2
       val1 = EXP_HIGHEST ();
50ece2
 
50ece2
       if (set_noeval)
50ece2
 	noeval--;
50ece2
       if (curtok != COL)
50ece2
 	evalerror (_("`:' expected for conditional expression"));
50ece2
-      readtok ();
50ece2
-      if (curtok == 0)
50ece2
-	evalerror (_("expression expected"));
50ece2
+
50ece2
       set_noeval = 0;
50ece2
       if (cval)
50ece2
  	{
50ece2
@@ -603,7 +602,11 @@ expcond ()
50ece2
 	  noeval++;
50ece2
  	}
50ece2
 
50ece2
+      readtok ();
50ece2
+      if (curtok == 0)
50ece2
+	evalerror (_("expression expected"));
50ece2
       val2 = expcond ();
50ece2
+
50ece2
       if (set_noeval)
50ece2
 	noeval--;
50ece2
       rval = cval ? val1 : val2;
50ece2
diff --git a/patchlevel.h b/patchlevel.h
50ece2
index deb9c5b..16c8740 100644
50ece2
--- a/patchlevel.h
50ece2
+++ b/patchlevel.h
50ece2
@@ -25,6 +25,6 @@
50ece2
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
50ece2
    looks for to find the patch level (for the sccs version string). */
50ece2
 
50ece2
-#define PATCHLEVEL 7
50ece2
+#define PATCHLEVEL 8
50ece2
 
50ece2
 #endif /* _PATCHLEVEL_H_ */
50ece2
-- 
50ece2
2.9.3
50ece2