ext/redcloth_scan/redcloth_inline.c.rl in BBRedCloth-0.8.4 vs ext/redcloth_scan/redcloth_inline.c.rl in BBRedCloth-0.8.5

- old
+ new

@@ -38,12 +38,12 @@ } VALUE red_passthrough(VALUE self, char *ts, char *te, VALUE refs) { - VALUE ret = rb_str_new(ts,1); - VALUE txt = rb_str_new(ts+1,te-ts-2); + VALUE ret = STR_NEW(ts,1); + VALUE txt = STR_NEW(ts+1,te-ts-2); if (!NIL_P(txt)) { //printf("red_passthrough() '%s'\n", RSTRING(txt)->ptr); if (rb_funcall(self, rb_intern("bbcode_only"), 0) == Qtrue){ rb_str_append(ret,redcloth_bbcode_inline2(self, txt, refs)); @@ -75,11 +75,11 @@ VALUE red_pass_code(VALUE self, VALUE regs, VALUE ref, ID meth) { VALUE txt = rb_hash_aref(regs, ref); if (!NIL_P(txt)) { - VALUE txt2 = rb_str_new2(""); + VALUE txt2 = STR_NEW2(""); rb_str_cat_escaped_for_preformatted(self, txt2, RSTRING_PTR(txt), RSTRING_PTR(txt) + RSTRING_LEN(txt)); rb_hash_aset(regs, ref, txt2); } return rb_funcall(self, meth, 1, regs); } @@ -143,18 +143,18 @@ VALUE refs; { int cs, act; char *ts, *te, *reg, *eof; char *orig_p = p, *orig_pe = pe; - VALUE block = rb_str_new2(""); + VALUE block = STR_NEW2(""); VALUE regs = Qnil; unsigned int opts = 0; VALUE buf = Qnil; VALUE hash = Qnil; - VALUE html = rb_str_new2(""); - VALUE failed_start = rb_str_new2(""); + VALUE html = STR_NEW2(""); + VALUE failed_start = STR_NEW2(""); int stack[CALL_STACK_SIZE],top; %% write init; %% write exec; @@ -170,30 +170,30 @@ void rb_str_cat_escaped(self, str, ts, te) VALUE self, str; char *ts, *te; { - VALUE source_str = rb_str_new(ts, te-ts); + VALUE source_str = STR_NEW(ts, te-ts); VALUE escaped_str = rb_funcall(self, rb_intern("escape"), 1, source_str); rb_str_concat(str, escaped_str); } void rb_str_cat_escaped_for_preformatted(self, str, ts, te) VALUE self, str; char *ts, *te; { - VALUE source_str = rb_str_new(ts, te-ts); + VALUE source_str = STR_NEW(ts, te-ts); VALUE escaped_str = rb_funcall(self, rb_intern("escape_pre"), 1, source_str); rb_str_concat(str, escaped_str); } void rb_str_cat_escaped_test(self, str, ts, te) VALUE self, str; char *ts, *te; { - VALUE source_str = rb_str_new(ts, te-ts); + VALUE source_str = STR_NEW(ts, te-ts); rb_str_concat(str, source_str); } VALUE redcloth_inline2(self, str, refs)