ruby-changes:13560
From: shugo <ko1@a...>
Date: Thu, 15 Oct 2009 12:02:48 +0900 (JST)
Subject: [ruby-changes:13560] Ruby:r25340 (ruby_1_8): * lib/net/imap.rb (resp_text_code): accepts response codes without
shugo 2009-10-15 12:01:29 +0900 (Thu, 15 Oct 2009) New Revision: 25340 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25340 Log: * lib/net/imap.rb (resp_text_code): accepts response codes without text. backported from trunk. [ruby-core:24194] Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/net/imap.rb Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 25339) +++ ruby_1_8/ChangeLog (revision 25340) @@ -1,3 +1,8 @@ +Thu Oct 15 12:01:11 2009 Shugo Maeda <shugo@r...> + + * lib/net/imap.rb (resp_text_code): accepts response codes without + text. backported from trunk. [ruby-core:24194] + Tue Oct 13 18:54:25 2009 Hidetoshi NAGAI <nagai@a...> * ext/tk/variable.rb: bug fix. additional trace definition changes the Index: ruby_1_8/lib/net/imap.rb =================================================================== --- ruby_1_8/lib/net/imap.rb (revision 25339) +++ ruby_1_8/lib/net/imap.rb (revision 25340) @@ -2764,11 +2764,16 @@ match(T_SPACE) result = ResponseCode.new(name, number) else - match(T_SPACE) - @lex_state = EXPR_CTEXT - token = match(T_TEXT) - @lex_state = EXPR_BEG - result = ResponseCode.new(name, token.value) + token = lookahead + if token.symbol == T_SPACE + shift_token + @lex_state = EXPR_CTEXT + token = match(T_TEXT) + @lex_state = EXPR_BEG + result = ResponseCode.new(name, token.value) + else + result = ResponseCode.new(name, nil) + end end match(T_RBRA) @lex_state = EXPR_RTEXT -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/