summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-11-26 15:45:52 +0900
committergit <svn-admin@ruby-lang.org>2025-11-26 06:50:54 +0000
commit525ee3ab260039d71bc210e442686fdfc35262ee (patch)
tree8682cfbb524cec6a14539f74e07a6e9a648da7be
parent43ed35de6c1759feef57dbad0a2fad045ee2751f (diff)
[ruby/cgi] Fix mixed declarations and code
Use C90 syntax only, as far as supporting ruby 2.6 or earlier. https://github.com/ruby/cgi/commit/886c82982a
-rw-r--r--ext/cgi/escape/escape.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c
index 6b00bc37c1..4773186603 100644
--- a/ext/cgi/escape/escape.c
+++ b/ext/cgi/escape/escape.c
@@ -45,6 +45,7 @@ escaped_length(VALUE str)
static VALUE
optimized_escape_html(VALUE str)
{
+ VALUE escaped;
VALUE vbuf;
char *buf = ALLOCV_N(char, vbuf, escaped_length(str));
const char *cstr = RSTRING_PTR(str);
@@ -63,7 +64,6 @@ optimized_escape_html(VALUE str)
}
}
- VALUE escaped;
if (RSTRING_LEN(str) < (dest - buf)) {
escaped = rb_str_new(buf, dest - buf);
preserve_original_state(str, escaped);