1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

readline: remove dependency on internal.h

* ext/readline/depend: remove dependency on internal.h.

* ext/readline/readline.c (readline_s_delete_text): use
  rb_enc_str_new_static instead of rb_setup_fake_str not to depend
  on internal.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-11-13 02:11:07 +00:00
parent ffa371d9aa
commit 48d5a921ab
2 changed files with 1 additions and 4 deletions

View file

@ -13,6 +13,5 @@ readline.o: $(hdrdir)/ruby/st.h
readline.o: $(hdrdir)/ruby/subst.h
readline.o: $(hdrdir)/ruby/thread.h
readline.o: $(top_srcdir)/include/ruby.h
readline.o: $(top_srcdir)/internal.h
readline.o: readline.c
# AUTOGENERATED DEPENDENCIES END

View file

@ -33,7 +33,6 @@
#include <editline/readline.h>
#endif
#include "internal.h"
#include "ruby/io.h"
#include "ruby/thread.h"
@ -706,8 +705,7 @@ readline_s_delete_text(int argc, VALUE *argv, VALUE self)
if (rl_line_buffer) {
char *p, *ptr = rl_line_buffer;
long beg = 0, len = strlen(rl_line_buffer);
struct RString fakestr;
VALUE str = rb_setup_fake_str(&fakestr, ptr, len, rb_locale_encoding());
VALUE str = rb_enc_str_new_static(ptr, len, rb_locale_encoding());
OBJ_FREEZE(str);
if (argc == 2) {
beg = NUM2LONG(argv[0]);