Skip to content

Commit

Permalink
ANSI: make it so x position can't be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Jul 16, 2017
1 parent 7606f81 commit 84d1628
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions phpseclib/File/ANSI.php
Expand Up @@ -332,6 +332,9 @@ function appendString($source)
case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines
$this->old_x = $this->x;
$this->x-= $match[1];
if ($this->x < 0) {
$this->x = 0;
}
break;
case preg_match('#\x1B\[(\d+);(\d+)r#', $this->ansi, $match): // Set top and bottom lines of a window
break;
Expand Down

1 comment on commit 84d1628

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1150

Please sign in to comment.