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