summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-06-12 09:11:43 -0700
committerJeremy Evans <code@jeremyevans.net>2020-06-12 09:11:43 -0700
commitb212c7c7d136dad7391874c5c9ba0b77df5653e2 (patch)
treeea430e87511bf85c8ed17685e84bca7acf8ae872 /enum.c
parent510df47f5f7f83918d3aa00316c8a5b959d80d7c (diff)
Update example code in Enumerator#chunk documentation [ci skip]
The code assumed that /usr/share/dict/words did not use mixed case, and it does at least on a few operating systems. From CryptoRAT (Luke Elliot) Fixes [Bug #16957]
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index f49b684f1c..8c8adcfe42 100644
--- a/enum.c
+++ b/enum.c
@@ -3203,7 +3203,7 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* The following example counts words for each initial letter.
*
* open("/usr/share/dict/words", "r:iso-8859-1") { |f|
- * f.chunk { |line| line.ord }.each { |ch, lines| p [ch.chr, lines.length] }
+ * f.chunk { |line| line.upcase.ord }.each { |ch, lines| p [ch.chr, lines.length] }
* }
* #=> ["\n", 1]
* # ["A", 1327]