462fb2
			     BASH PATCH REPORT
462fb2
			     =================
462fb2
462fb2
Bash-Release:	4.2
462fb2
Patch-ID:	bash42-023
462fb2
462fb2
Bug-Reported-by:	Ewan Mellor <Ewan.Mellor@eu.citrix.com>
462fb2
Bug-Reference-ID:	<6005BE083BF501439A84DC3523BAC82DC4B964FD12@LONPMAILBOX01.citrite.net>
462fb2
Bug-Reference-URL:	
462fb2
462fb2
Bug-Description:
462fb2
462fb2
Under some circumstances, an exit trap triggered by a bad substitution
462fb2
error when errexit is enabled will cause the shell to exit with an
462fb2
incorrect exit status (0).
462fb2
462fb2
Patch (apply with `patch -p0'):
462fb2
462fb2
*** ../bash-4.2-patched/subst.c	2011-11-21 12:04:38.000000000 -0500
462fb2
--- subst.c	2012-02-08 13:36:28.000000000 -0500
462fb2
***************
462fb2
*** 7275,7278 ****
462fb2
--- 7281,7285 ----
462fb2
      case '\0':
462fb2
      bad_substitution:
462fb2
+       last_command_exit_value = EXECUTION_FAILURE;
462fb2
        report_error (_("%s: bad substitution"), string ? string : "??");
462fb2
        FREE (value);
462fb2
*** ../bash-4.2-patched/error.c	2009-08-21 22:31:31.000000000 -0400
462fb2
--- error.c	2012-02-25 15:54:40.000000000 -0500
462fb2
***************
462fb2
*** 201,205 ****
462fb2
    va_end (args);
462fb2
    if (exit_immediately_on_error)
462fb2
!     exit_shell (1);
462fb2
  }
462fb2
  
462fb2
--- 201,209 ----
462fb2
    va_end (args);
462fb2
    if (exit_immediately_on_error)
462fb2
!     {
462fb2
!       if (last_command_exit_value == 0)
462fb2
! 	last_command_exit_value = 1;
462fb2
!       exit_shell (last_command_exit_value);
462fb2
!     }
462fb2
  }
462fb2
  
462fb2
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
462fb2
--- patchlevel.h	Thu Feb 24 21:41:34 2011
462fb2
***************
462fb2
*** 26,30 ****
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 22
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */
462fb2
--- 26,30 ----
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 23
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */