summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-23 13:59:16 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-23 13:59:16 +0000
commitab284526a4d597417286b1d1dab8f094e71f552a (patch)
treecb5f1a018d1913acf8558af39c7068a0b2700b72 /enum.c
parenta3e10f380ab276cc9192418d2a19c7e0ffc86046 (diff)
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/enum.c b/enum.c
index f5c4748308..b69d8c9b6f 100644
--- a/enum.c
+++ b/enum.c
@@ -2489,6 +2489,7 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* i = mail.index("\n")
* header = mail[0...i]
* body = mail[(i+1)..-1]
+ * body.pop if body.last == "\n"
* fields = header.slice_before {|line| !" \t".include?(line[0]) }.to_a
* p unix_from
* pp fields
@@ -2499,11 +2500,13 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* # split mails in mbox (slice before Unix From line after an empty line)
* open("mbox") {|f|
* f.slice_before(emp: true) {|line,h|
- * prevemp = h[:emp]
- * h[:emp] = line == "\n"
- * prevemp && line.start_with?("From ")
- * }.each {|mail|
- * pp mail
+ * prevemp = h[:emp]
+ * h[:emp] = line == "\n"
+ * prevemp && line.start_with?("From ")
+ * }.each {|mail|
+ * mail.pop if mail.last == "\n"
+ * pp mail
+ * }
* }
*
*/