aboutsummaryrefslogtreecommitdiffstats
path: root/ext/cgi
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-30 04:16:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-30 04:16:43 +0000
commit8097d34a25446665793441d2bf249969a940e322 (patch)
tree7843f998b9100fe3622b7d265fa87d471d4a24cf /ext/cgi
parent087fdb4ab16090af862ad09c11f2eeff30737525 (diff)
downloadruby-8097d34a25446665793441d2bf249969a940e322.tar.gz
Initialize ID
* ext/cgi/escape/escape.c (accept_charset): initialize the static ID for theha class variable once at first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/cgi')
-rw-r--r--ext/cgi/escape/escape.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c
index 75278a5399..f11a72cd82 100644
--- a/ext/cgi/escape/escape.c
+++ b/ext/cgi/escape/escape.c
@@ -9,6 +9,7 @@ RUBY_EXTERN const signed char ruby_digit36_to_number_table[];
#define char_to_number(c) ruby_digit36_to_number_table[(unsigned char)(c)]
static VALUE rb_cCGI, rb_mUtil, rb_mEscape;
+static ID id_accept_charset;
static void
html_escaped_cat(VALUE str, char c)
@@ -186,7 +187,7 @@ optimized_unescape_html(VALUE str)
}
}
-static int
+static unsigned char
url_unreserved_char(unsigned char c)
{
switch (c) {
@@ -374,7 +375,7 @@ accept_charset(int argc, VALUE *argv, VALUE self)
{
if (argc > 0)
return argv[0];
- return rb_cvar_get(CLASS_OF(self), rb_intern("@@accept_charset"));
+ return rb_cvar_get(CLASS_OF(self), id_accept_charset);
}
/*
@@ -403,6 +404,13 @@ cgiesc_unescape(int argc, VALUE *argv, VALUE self)
void
Init_escape(void)
{
+ id_accept_charset = rb_intern_const("@@accept_charset");
+ InitVM(escape);
+}
+
+void
+InitVM_escape(void)
+{
rb_cCGI = rb_define_class("CGI", rb_cObject);
rb_mEscape = rb_define_module_under(rb_cCGI, "Escape");
rb_mUtil = rb_define_module_under(rb_cCGI, "Util");