Skip to content

Commit

Permalink
Small fix in checkresponse()
Browse files Browse the repository at this point in the history
  • Loading branch information
zaf committed Aug 10, 2015
1 parent 99a3282 commit 0012a09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
12 changes: 3 additions & 9 deletions speech-recog-tiny.agi
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,9 @@ sub checkresponse {
my @values;

chomp $input;
if ($input =~ /^200/) {
$input =~ /result=(-?\d+)\s?(.*)$/;
if (!length($1)) {
warn "$name Command failed: $input\n";
@values = (-1, -1);
} else {
warn "$name Command returned: $input\n" if ($debug);
@values = ("$1", "$2");
}
if ($input =~ /^200 result=(-?\d+)\s?(.*)$/) {
warn "$name Command returned: $input\n" if ($debug);
@values = ("$1", "$2");
} else {
$input .= <STDIN> if ($input =~ /^520-Invalid/);
warn "$name Unexpected result: $input\n";
Expand Down
12 changes: 3 additions & 9 deletions speech-recog.agi
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,9 @@ sub checkresponse {
my @values;

chomp $input;
if ($input =~ /^200/) {
$input =~ /result=(-?\d+)\s?(.*)$/;
if (!length($1)) {
warn "$name Command failed: $input\n";
@values = (-1, -1);
} else {
warn "$name Command returned: $input\n" if ($debug);
@values = ("$1", "$2");
}
if ($input =~ /^200 result=(-?\d+)\s?(.*)$/) {
warn "$name Command returned: $input\n" if ($debug);
@values = ("$1", "$2");
} else {
$input .= <STDIN> if ($input =~ /^520-Invalid/);
warn "$name Unexpected result: $input\n";
Expand Down

0 comments on commit 0012a09

Please sign in to comment.