summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext
diff options
context:
space:
mode:
authordearblue <[email protected]>2021-05-05 19:01:57 +0900
committerdearblue <[email protected]>2021-05-05 22:16:03 +0900
commit6fc5dc986a5ffc1a74c63ad0617ea1dcc10d3cdd (patch)
tree86da312642d6093ebd28452e13c295a842ed118a /mrbgems/mruby-string-ext
parent35a6dfe905ec3cca51dabbcc8d17032c9f3a305c (diff)
downloadmruby-6fc5dc986a5ffc1a74c63ad0617ea1dcc10d3cdd.tar.gz
mruby-6fc5dc986a5ffc1a74c63ad0617ea1dcc10d3cdd.zip
Extend the tab with 8 whitespace
This work was done as follows: - check: `git grep $'\011' -- :^oss-fuzz` - convert: `ruby -pi -e 'nil while $_.sub!(/^(.*?)\t/) { $1 + " " * (8 - $1.size % 8) }'` The `doc/guide/{compile,mrbgems}.md` file adds and removes whitespace to make the directory tree look the same. In `mrbgems/mruby-socket/src/socket.c`, there is a part where the indent is changed from 4 to 2 at the same time as the tab is changed.
Diffstat (limited to 'mrbgems/mruby-string-ext')
-rw-r--r--mrbgems/mruby-string-ext/src/string.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mrbgems/mruby-string-ext/src/string.c b/mrbgems/mruby-string-ext/src/string.c
index 09cbf7995..3a9926525 100644
--- a/mrbgems/mruby-string-ext/src/string.c
+++ b/mrbgems/mruby-string-ext/src/string.c
@@ -262,7 +262,7 @@ enum tr_pattern_type {
<range> ::= <ch> '-' <ch>
*/
struct tr_pattern {
- uint8_t type; // 1:in-order, 2:range
+ uint8_t type; // 1:in-order, 2:range
mrb_bool flag_reverse : 1;
mrb_bool flag_on_heap : 1;
uint16_t n;
@@ -329,9 +329,9 @@ tr_parse_pattern(mrb_state *mrb, struct tr_pattern *ret, const mrb_value v_patte
mrb_int len;
while (i < pattern_length) {
- if ((i+2) < pattern_length && pattern[i] != '\\' && pattern[i+1] == '-')
+ if ((i+2) < pattern_length && pattern[i] != '\\' && pattern[i+1] == '-')
break;
- i++;
+ i++;
}
len = i - start_pos;
@@ -375,7 +375,7 @@ tr_find_character(const struct tr_pattern *pat, const char *pat_str, int ch)
if (pat->type == TR_IN_ORDER) {
int i;
for (i = 0; i < pat->n; i++) {
- if (pat_str[pat->val.start_pos + i] == ch) ret = n_sum + i;
+ if (pat_str[pat->val.start_pos + i] == ch) ret = n_sum + i;
}
}
else if (pat->type == TR_RANGE) {
@@ -509,7 +509,7 @@ str_tr(mrb_state *mrb, mrb_value str, mrb_value p1, mrb_value p2, mrb_bool squee
if (n >= 0) {
flag_changed = TRUE;
if (rep == NULL) {
- j--;
+ j--;
}
else {
mrb_int c = tr_get_character(rep, RSTRING_PTR(p2), n);
@@ -521,8 +521,8 @@ str_tr(mrb_state *mrb, mrb_value str, mrb_value p1, mrb_value p2, mrb_bool squee
if (c > 0x80) {
mrb_raisef(mrb, E_ARGUMENT_ERROR, "character (%i) out of range", c);
}
- lastch = c;
- s[i] = (char)c;
+ lastch = c;
+ s[i] = (char)c;
}
}
}