summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-09-02 10:40:17 -0700
committerJeremy Evans <code@jeremyevans.net>2020-09-02 10:41:49 -0700
commitd9b8411a7be4c9e300b75bc374f29e6965ab3040 (patch)
tree18e6eb2859677ff2698114c1220708a0414eb6e5 /ext
parent0938bad0a531fe594851ae8a8f5d0eac0444ee46 (diff)
Document that StringScanner#matched_size returns size in bytes [ci skip]
Fixes [Bug #17139]
Diffstat (limited to 'ext')
-rw-r--r--ext/strscan/strscan.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index 7edd1bf0c2..61c8d8972c 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -1089,8 +1089,9 @@ strscan_matched(VALUE self)
}
/*
- * Returns the size of the most recent match (see #matched), or +nil+ if there
- * was no recent match.
+ * Returns the size of the most recent match in bytes, or +nil+ if there
+ * was no recent match. This is different than <tt>matched.size</tt>,
+ * which will return the size in characters.
*
* s = StringScanner.new('test string')
* s.check /\w+/ # -> "test"