ruby-changes:56010
From: git <ko1@a...>
Date: Wed, 5 Jun 2019 11:02:16 +0900 (JST)
Subject: [ruby-changes:56010] git: 6b66a76f43 (trunk): * expand tabs.
https://git.ruby-lang.org/ruby.git/commit/?id=6b66a76f43 From 6b66a76f43038eb4b789f0f94729ddcc233d9c56 Mon Sep 17 00:00:00 2001 From: git <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Wed, 5 Jun 2019 11:01:59 +0900 Subject: * expand tabs. diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c index ced1b18..78d196d 100644 --- a/ext/cgi/escape/escape.c +++ b/ext/cgi/escape/escape.c @@ -16,20 +16,20 @@ html_escaped_cat(VALUE str, char c) https://github.com/ruby/ruby/blob/trunk/ext/cgi/escape/escape.c#L16 { switch (c) { case '\'': - rb_str_cat_cstr(str, "'"); - break; + rb_str_cat_cstr(str, "'"); + break; case '&': - rb_str_cat_cstr(str, "&"); - break; + rb_str_cat_cstr(str, "&"); + break; case '"': - rb_str_cat_cstr(str, """); - break; + rb_str_cat_cstr(str, """); + break; case '<': - rb_str_cat_cstr(str, "<"); - break; + rb_str_cat_cstr(str, "<"); + break; case '>': - rb_str_cat_cstr(str, ">"); - break; + rb_str_cat_cstr(str, ">"); + break; } } @@ -52,28 +52,28 @@ optimized_escape_html(VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/cgi/escape/escape.c#L52 cstr = RSTRING_PTR(str); for (i = 0; i < len; i++) { - switch (cstr[i]) { - case '\'': - case '&': - case '"': - case '<': - case '>': - if (!dest) { - dest = rb_str_buf_new(len); - } - - rb_str_cat(dest, cstr + beg, i - beg); - beg = i + 1; - - html_escaped_cat(dest, cstr[i]); - break; - } + switch (cstr[i]) { + case '\'': + case '&': + case '"': + case '<': + case '>': + if (!dest) { + dest = rb_str_buf_new(len); + } + + rb_str_cat(dest, cstr + beg, i - beg); + beg = i + 1; + + html_escaped_cat(dest, cstr[i]); + break; + } } if (dest) { - rb_str_cat(dest, cstr + beg, len - beg); - preserve_original_state(str, dest); - return dest; + rb_str_cat(dest, cstr + beg, len - beg); + preserve_original_state(str, dest); + return dest; } else { return rb_str_dup(str); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/