Skip to content

Commit

Permalink
修正代码逻辑错误。
Browse files Browse the repository at this point in the history
使用_reponse_info返回是列表,不能直接使用。
  • Loading branch information
Geng Shuang committed May 3, 2012
1 parent 54e53c1 commit bff0705
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions lib/Response.pm
Expand Up @@ -142,10 +142,7 @@ use Class::Std::Utils; {
} }
elsif ('G' eq uc $ucmd) { elsif ('G' eq uc $ucmd) {
$result{ident $self}{command} = $next; $result{ident $self}{command} = $next;
my $next_field = $result{ident $self}{command}; $self -> _guide_reponse();
$next_field =~ s/^G\+//;
$result{ident $self}{content} .= get_word_replace('GUIDE_TITLE', 'TITLE' => $next_field);
$result{ident $self}{content} .= $self -> _reponse_info($next);
} }
else { else {
$result{ident $self}{content} = get_word_nowarp($next); $result{ident $self}{content} = get_word_nowarp($next);
Expand Down Expand Up @@ -200,12 +197,7 @@ use Class::Std::Utils; {


$result{ident $self}{content} = get_word($word); $result{ident $self}{content} = get_word($word);
if (GetNext($result{ident $self}{command})) { if (GetNext($result{ident $self}{command})) {
my $next_field = $result{ident $self}{command}; $self -> _guide_reponse();
$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;
} }
else { else {
$result{ident $self}{content} .= get_word('GUIDE_FINISH'); $result{ident $self}{content} .= get_word('GUIDE_FINISH');
Expand Down Expand Up @@ -284,6 +276,17 @@ use Class::Std::Utils; {


return ($retsta, $retstr); 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; return 1;

0 comments on commit bff0705

Please sign in to comment.