ruby-changes:24077
From: naruse <ko1@a...>
Date: Tue, 19 Jun 2012 11:58:56 +0900 (JST)
Subject: [ruby-changes:24077] naruse:r36128 (trunk): * ext/readline/readline.c (readline_s_get_special_prefixes): suppress
naruse 2012-06-19 11:58:43 +0900 (Tue, 19 Jun 2012) New Revision: 36128 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36128 Log: * ext/readline/readline.c (readline_s_get_special_prefixes): suppress warning: unitinialized instance variable. Modified files: trunk/ChangeLog trunk/ext/readline/readline.c trunk/test/readline/test_readline_history.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36127) +++ ChangeLog (revision 36128) @@ -1,3 +1,8 @@ +Tue Jun 19 11:52:59 2012 NARUSE, Yui <naruse@r...> + + * ext/readline/readline.c (readline_s_get_special_prefixes): suppress + warning: unitinialized instance variable. + Tue Jun 19 11:43:16 2012 NARUSE, Yui <naruse@r...> * ext/readline/readline.c (readline_getc): fix editline compatibility Index: ext/readline/readline.c =================================================================== --- ext/readline/readline.c (revision 36127) +++ ext/readline/readline.c (revision 36128) @@ -1248,6 +1248,7 @@ { VALUE str; rb_secure(4); + if (rl_special_prefixes == NULL) return Qnil; str = rb_ivar_get(mReadline, id_special_prefixes); if (!NIL_P(str)) { str = rb_str_dup_frozen(str); Index: test/readline/test_readline_history.rb =================================================================== --- test/readline/test_readline_history.rb (revision 36127) +++ test/readline/test_readline_history.rb (revision 36128) @@ -94,7 +94,7 @@ end def test_get__out_of_range - lines = push_history(5) + push_history(5) invalid_indexes = [5, 6, 100, -6, -7, -100] invalid_indexes.each do |i| assert_raise(IndexError, "i=<#{i}>") do @@ -113,7 +113,7 @@ def test_set begin - lines = push_history(5) + push_history(5) 5.times do |i| expected = "set: #{i}" HISTORY[i] = expected @@ -128,7 +128,7 @@ HISTORY[0] = "set: 0" end - lines = push_history(5) + push_history(5) invalid_indexes = [5, 6, 100, -6, -7, -100] invalid_indexes.each do |i| assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do @@ -277,7 +277,7 @@ HISTORY.delete_at(0) end - lines = push_history(5) + push_history(5) invalid_indexes = [5, 6, 100, -6, -7, -100] invalid_indexes.each do |i| assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/