summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMark Thorn <mcthorn@gmail.com>2020-03-03 10:03:28 -0800
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-05 11:49:56 +0900
commitf2459763862fa2eef6929557a87763fe5ff5c470 (patch)
treeee834e093a66e42bd9ddfda618fea0d2f2ba614a /ext
parent5ed58b90d188b26e5369397b48edaba287ab09fe (diff)
[ruby/psych] Fix ArgumentError with leading and trailing underscores in number strings.
https://github.com/ruby/psych/commit/ac2d2c9b1b
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3188
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb
index cea2a453dd..d565a336e8 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -101,7 +101,7 @@ module Psych
###
# Parse and return an int from +string+
def parse_int string
- Integer(string.gsub(/[,]/, ''))
+ Integer(string.gsub(/[,_]/, ''))
end
###