summaryrefslogtreecommitdiff
path: root/ext/cgi
diff options
context:
space:
mode:
authorgit <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-06-05 11:01:59 +0900
committergit <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-06-05 11:01:59 +0900
commit6b66a76f43038eb4b789f0f94729ddcc233d9c56 (patch)
tree321dd9c902b53aa4100208bc37bc060937b00097 /ext/cgi
parent71b14affc6b699f38aabe73125380cab57799e34 (diff)
* expand tabs.
Diffstat (limited to 'ext/cgi')
-rw-r--r--ext/cgi/escape/escape.c58
1 files changed, 29 insertions, 29 deletions
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)
{
switch (c) {
case '\'':
- rb_str_cat_cstr(str, "&#39;");
- break;
+ rb_str_cat_cstr(str, "&#39;");
+ break;
case '&':
- rb_str_cat_cstr(str, "&amp;");
- break;
+ rb_str_cat_cstr(str, "&amp;");
+ break;
case '"':
- rb_str_cat_cstr(str, "&quot;");
- break;
+ rb_str_cat_cstr(str, "&quot;");
+ break;
case '<':
- rb_str_cat_cstr(str, "&lt;");
- break;
+ rb_str_cat_cstr(str, "&lt;");
+ break;
case '>':
- rb_str_cat_cstr(str, "&gt;");
- break;
+ rb_str_cat_cstr(str, "&gt;");
+ break;
}
}
@@ -52,28 +52,28 @@ optimized_escape_html(VALUE str)
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);