Unverified Commit 152e8c5b authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4127 from clayton-shopify/fix-str-squeeze-comparisons

Fix comparisons in str_squeeze.
parents 4d5e3e1e 7b04fcd0
...@@ -543,7 +543,7 @@ str_squeeze(mrb_state *mrb, mrb_value str, mrb_value v_pat) ...@@ -543,7 +543,7 @@ str_squeeze(mrb_state *mrb, mrb_value str, mrb_value v_pat)
{ {
struct tr_pattern *pat = NULL; struct tr_pattern *pat = NULL;
mrb_int i; mrb_int i;
char *s; unsigned char *s;
mrb_int len; mrb_int len;
mrb_bool flag_changed = FALSE; mrb_bool flag_changed = FALSE;
mrb_int lastch = -1; mrb_int lastch = -1;
...@@ -552,7 +552,7 @@ str_squeeze(mrb_state *mrb, mrb_value str, mrb_value v_pat) ...@@ -552,7 +552,7 @@ str_squeeze(mrb_state *mrb, mrb_value str, mrb_value v_pat)
if (!mrb_nil_p(v_pat)) { if (!mrb_nil_p(v_pat)) {
pat = tr_parse_pattern(mrb, pat, v_pat, TRUE); pat = tr_parse_pattern(mrb, pat, v_pat, TRUE);
} }
s = RSTRING_PTR(str); s = (unsigned char *)RSTRING_PTR(str);
len = RSTRING_LEN(str); len = RSTRING_LEN(str);
if (pat) { if (pat) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment