From 605d257e1ae2635b480c62b302b610e086b4f48e Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Fri, 30 Jun 2006 10:46:40 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@10434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/webrick/httputils.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f9e911784..611fb7481 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jun 30 19:35:41 2006 GOTOU Yuuzou + + * 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 * gc.c (gc_mark_children): a bug in NODE_BLOCK_PASS marking. diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb index e660f0440..c93146997 100644 --- a/lib/webrick/httputils.rb +++ b/lib/webrick/httputils.rb @@ -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) -- cgit