From 1ed5a285ba927375fc68bc6775b7bee542904a1b Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 10 Sep 2007 11:51:59 +0000 Subject: [PATCH] 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 --- cake/console/cake.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 891d68b8d..5b033e7ef 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -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;