diff options
| author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-15 03:01:29 +0000 |
|---|---|---|
| committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-15 03:01:29 +0000 |
| commit | 22de98b53b7f56dbbd491c4bd38137602d92abb1 (patch) | |
| tree | ef2855cc08408ebf969fd0366e543677fdb1e721 /lib | |
| parent | a9495252b841074f3607cf50865fd88e26299f86 (diff) | |
* lib/net/imap.rb (resp_text_code): accepts response codes without
text. backported from trunk. [ruby-core:24194]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/net/imap.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 6162ffa0d0..b42b0d1dea 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -2764,11 +2764,16 @@ module Net 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 |
