mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* regex.c (re_compile_pattern): fix previous change.
* instruby.rb, ext/extmk.rb, ext/tk/lib/tk.rb, lib/benchmark.rb, lib/cgi.rb, lib/debug.rb, lib/getoptlong.rb, lib/jcode.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb: escape `[', `]', `-' in chracter class in regexp to avoid warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
108cf940d8
commit
58ef7c2088
14 changed files with 56 additions and 46 deletions
|
@ -69,9 +69,9 @@ class Time
|
|||
def zone_offset(zone, year=Time.now.year)
|
||||
off = nil
|
||||
zone = zone.upcase
|
||||
if /\A([-+])(\d\d):?(\d\d)\z/ =~ zone
|
||||
if /\A([\-+])(\d\d):?(\d\d)\z/ =~ zone
|
||||
off = ($1 == '-' ? -1 : 1) * ($2.to_i * 60 + $3.to_i) * 60
|
||||
elsif /\A[-+]\d\d\z/ =~ zone
|
||||
elsif /\A[\-+]\d\d\z/ =~ zone
|
||||
off = zone.to_i * 3600
|
||||
elsif ZoneOffset.include?(zone)
|
||||
off = ZoneOffset[zone] * 3600
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue