svashisht / rpms / bash

Forked from rpms/bash 4 years ago
Clone

Blame SOURCES/bash42-035

ff19ae
			     BASH PATCH REPORT
ff19ae
			     =================
ff19ae
ff19ae
Bash-Release:	4.2
ff19ae
Patch-ID:	bash42-035
ff19ae
ff19ae
Bug-Reported-by:	Dan Douglas <ormaaj@gmail.com>
ff19ae
Bug-Reference-ID:	<2766482.Ksm3GrSoYi@smorgbox>
ff19ae
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-06/msg00071.html
ff19ae
ff19ae
Bug-Description:
ff19ae
ff19ae
When given a number of lines to read, `mapfile -n lines' reads one too many.
ff19ae
ff19ae
Patch (apply with `patch -p0'):
ff19ae
ff19ae
*** ../bash-4.2-patched/builtins/mapfile.def	2010-05-29 22:09:47.000000000 -0400
ff19ae
--- builtins/mapfile.def	2012-06-20 09:48:33.000000000 -0400
ff19ae
***************
ff19ae
*** 196,206 ****
ff19ae
    interrupt_immediately++;
ff19ae
    for (array_index = origin, line_count = 1; 
ff19ae
!        zgetline (fd, &line, &line_length, unbuffered_read) != -1;
ff19ae
!        array_index++, line_count++) 
ff19ae
      {
ff19ae
-       /* Have we exceeded # of lines to store? */
ff19ae
-       if (line_count_goal != 0 && line_count > line_count_goal) 
ff19ae
- 	break;
ff19ae
- 
ff19ae
        /* Remove trailing newlines? */
ff19ae
        if (flags & MAPF_CHOP)
ff19ae
--- 196,202 ----
ff19ae
    interrupt_immediately++;
ff19ae
    for (array_index = origin, line_count = 1; 
ff19ae
!  	zgetline (fd, &line, &line_length, unbuffered_read) != -1;
ff19ae
! 	array_index++) 
ff19ae
      {
ff19ae
        /* Remove trailing newlines? */
ff19ae
        if (flags & MAPF_CHOP)
ff19ae
***************
ff19ae
*** 218,221 ****
ff19ae
--- 214,222 ----
ff19ae
  
ff19ae
        bind_array_element (entry, array_index, line, 0);
ff19ae
+ 
ff19ae
+       /* Have we exceeded # of lines to store? */
ff19ae
+       line_count++;
ff19ae
+       if (line_count_goal != 0 && line_count > line_count_goal) 
ff19ae
+ 	break;
ff19ae
      }
ff19ae
  
ff19ae
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
ff19ae
--- patchlevel.h	Thu Feb 24 21:41:34 2011
ff19ae
***************
ff19ae
*** 26,30 ****
ff19ae
     looks for to find the patch level (for the sccs version string). */
ff19ae
  
ff19ae
! #define PATCHLEVEL 34
ff19ae
  
ff19ae
  #endif /* _PATCHLEVEL_H_ */
ff19ae
--- 26,30 ----
ff19ae
     looks for to find the patch level (for the sccs version string). */
ff19ae
  
ff19ae
! #define PATCHLEVEL 35
ff19ae
  
ff19ae
  #endif /* _PATCHLEVEL_H_ */