Merge pull request #77 from cowai/fix-read

Fix connection->read() when first line is not prompt.
This commit is contained in:
Robin Appelman 2019-03-04 16:02:42 +01:00 committed by GitHub
commit 26b7b87803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,7 +66,11 @@ class Connection extends RawConnection {
$this->parser->checkConnectionError($promptLine); $this->parser->checkConnectionError($promptLine);
$output = []; $output = [];
if (!$this->isPrompt($promptLine)) {
$line = $promptLine;
} else {
$line = $this->readLine(); $line = $this->readLine();
}
if ($line === false) { if ($line === false) {
$this->unknownError($promptLine); $this->unknownError($promptLine);
} }