From 03e7997fd0f231334c8fb8ce0af1ef6f4161351a Mon Sep 17 00:00:00 2001 From: Max Schwenk Date: Thu, 20 Sep 2018 21:47:05 -0700 Subject: [PATCH] Don't mutated passed options --- ext/redcarpet/rc_markdown.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/redcarpet/rc_markdown.c b/ext/redcarpet/rc_markdown.c index 905148e7..df016fbb 100644 --- a/ext/redcarpet/rc_markdown.c +++ b/ext/redcarpet/rc_markdown.c @@ -115,8 +115,8 @@ static VALUE rb_redcarpet_md__new(int argc, VALUE *argv, VALUE klass) /* Merge the current options in the @options hash */ if (hash != Qnil) { - rndr_options = rb_iv_get(rb_rndr, "@options"); - rb_funcall(rndr_options, rb_intern("merge!"), 1, hash); + rndr_options = rb_funcall(rb_iv_get(rb_rndr, "@options"), rb_intern("merge"), 1, hash); + rb_iv_set(rb_rndr, "@options", rndr_options); } markdown = sd_markdown_new(extensions, 16, &rndr->callbacks, &rndr->options);