Permalink
Browse files

修正代码逻辑错误。

使用_reponse_info返回是列表,不能直接使用。
  • Loading branch information...
1 parent 54e53c1 commit bff0705144e41d6a881bad36568bf182abbb1326 Geng Shuang committed May 3, 2012
Showing with 13 additions and 10 deletions.
  1. +13 −10 lib/Response.pm
View
@@ -142,10 +142,7 @@ use Class::Std::Utils; {
}
elsif ('G' eq uc $ucmd) {
$result{ident $self}{command} = $next;
- my $next_field = $result{ident $self}{command};
- $next_field =~ s/^G\+//;
- $result{ident $self}{content} .= get_word_replace('GUIDE_TITLE', 'TITLE' => $next_field);
- $result{ident $self}{content} .= $self -> _reponse_info($next);
+ $self -> _guide_reponse();
}
else {
$result{ident $self}{content} = get_word_nowarp($next);
@@ -200,12 +197,7 @@ use Class::Std::Utils; {
$result{ident $self}{content} = get_word($word);
if (GetNext($result{ident $self}{command})) {
- my $next_field = $result{ident $self}{command};
- $next_field =~ s/^G\+//;
- $result{ident $self}{content} .= get_word_replace('GUIDE_TITLE', 'TITLE' => $next_field);
- my ($command, $content) = $self -> _reponse_info($result{ident $self}{command});
- $result{ident $self}{command} = $command;
- $result{ident $self}{content} .= $content;
+ $self -> _guide_reponse();
}
else {
$result{ident $self}{content} .= get_word('GUIDE_FINISH');
@@ -284,6 +276,17 @@ use Class::Std::Utils; {
return ($retsta, $retstr);
}
+
+ sub _guide_reponse {
+ my $self = shift;
+
+ my $next_field = $result{ident $self}{command};
+ $next_field =~ s/^G\+//;
+ $result{ident $self}{content} .= get_word_replace('GUIDE_TITLE', 'TITLE' => $next_field);
+ my ($command, $content) = $self -> _reponse_info($result{ident $self}{command});
+ $result{ident $self}{command} = $command;
+ $result{ident $self}{content} .= $content;
+ }
}
return 1;

0 comments on commit bff0705

Please sign in to comment.