Fixes #3220, Hitting Ctrl-D in a cake console, causes it to loop forever.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5623 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-09-10 11:51:59 +00:00
parent a41b962ae5
commit 1ed5a285ba

View file

@ -361,7 +361,12 @@ class ShellDispatcher {
} else {
$this->stdout($prompt . " $print_options \n" . "[$default] > ", false);
}
$result = trim(fgets($this->stdin));
$result = fgets($this->stdin);
if($result === false){
exit;
}
$result = trim($result);
if ($default != null && empty($result)) {
return $default;