Fix bad unit test with undefined offset (spotted by @stloyd)

This commit is contained in:
Lee McDermott 2013-01-08 03:51:15 +00:00 committed by Joseph Bielawski
parent 7f149ae0aa
commit cd1def3693
1 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ class DialogHelper extends Helper
}
} elseif (ord($c) < 32) {
if ("\t" === $c || "\n" === $c) {
if ($numMatches > 0) {
if ($numMatches > 0 && -1 !== $ofs) {
$ret = $matches[$ofs];
// Echo out remaining chars for current match
$output->write(substr($ret, $i));
@ -174,7 +174,7 @@ class DialogHelper extends Helper
// Erase characters from cursor to end of line
$output->write("\033[K");
if ($numMatches > 0) {
if ($numMatches > 0 && -1 !== $ofs) {
// Save cursor position
$output->write("\0337");
// Write highlighted text