summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2012-07-10 09:44:43 -0400
committerChet Ramey <chet.ramey@case.edu>2012-07-10 09:44:43 -0400
commit8e9dc917992612dccbb4efd85f8afd58947948d2 (patch)
treeb77a4af3c740e815e94fbc39e187e1c4ced31bd3
parent801b47cba557222becb1d6015e5664bc2405f52a (diff)
downloadbash-8e9dc917992612dccbb4efd85f8afd58947948d2.tar.gz
Bash-4.2 patch 35
-rw-r--r--builtins/mapfile.def13
-rw-r--r--patchlevel.h2
2 files changed, 8 insertions, 7 deletions
diff --git a/builtins/mapfile.def b/builtins/mapfile.def
index ec1e32e5..a5064a3a 100644
--- a/builtins/mapfile.def
+++ b/builtins/mapfile.def
@@ -195,13 +195,9 @@ mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_n
/* Reset the buffer for bash own stream */
interrupt_immediately++;
for (array_index = origin, line_count = 1;
- zgetline (fd, &line, &line_length, unbuffered_read) != -1;
- array_index++, line_count++)
+ zgetline (fd, &line, &line_length, unbuffered_read) != -1;
+ array_index++)
{
- /* Have we exceeded # of lines to store? */
- if (line_count_goal != 0 && line_count > line_count_goal)
- break;
-
/* Remove trailing newlines? */
if (flags & MAPF_CHOP)
do_chop (line);
@@ -217,6 +213,11 @@ mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_n
}
bind_array_element (entry, array_index, line, 0);
+
+ /* Have we exceeded # of lines to store? */
+ line_count++;
+ if (line_count_goal != 0 && line_count > line_count_goal)
+ break;
}
xfree (line);
diff --git a/patchlevel.h b/patchlevel.h
index a8cac106..1af8e562 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 34
+#define PATCHLEVEL 35
#endif /* _PATCHLEVEL_H_ */