1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/webrick/httputils.rb (WEBrick::HTTPUtils._escape): should

use String#ord to get ascii code from the one-character string.
  [ruby-dev:28901]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
gotoyuzo 2006-06-30 10:46:40 +00:00
parent 8fa6e7909d
commit 02c8eb1ba8
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Fri Jun 30 19:35:41 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httputils.rb (WEBrick::HTTPUtils._escape): should
use String#ord to get ascii code from the one-character string.
[ruby-dev:28901]
Thu Jun 29 23:56:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (gc_mark_children): a bug in NODE_BLOCK_PASS marking.

View file

@ -358,7 +358,7 @@ module WEBrick
def _make_regex(str) /([#{Regexp.escape(str)}])/n end
def _make_regex!(str) /([^#{Regexp.escape(str)}])/n end
def _escape(str, regex) str.gsub(regex){ "%%%02X" % $1[0] } end
def _escape(str, regex) str.gsub(regex){ "%%%02X" % $1.ord } end
def _unescape(str, regex) str.gsub(regex){ $1.hex.chr } end
UNESCAPED = _make_regex(control+space+delims+unwise+nonascii)