From 335a0d4737c62d936f48ea6d0bf2f00a9786d9ed Mon Sep 17 00:00:00 2001
From: Max Bronsema <maxbrons@uoregon.edu>
Date: Fri, 2 Dec 2011 15:16:57 -0800
Subject: [PATCH] Applied patch
 http://drupal.org/files/issues/1120848_drush_error_handler_1.patch
 to drush 4.5

---
 includes/environment.inc |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/includes/environment.inc b/includes/environment.inc
index 511638d..1a01b17 100644
--- a/includes/environment.inc
+++ b/includes/environment.inc
@@ -388,13 +388,15 @@ function drush_bootstrap_error($code, $message = null) {
  * handler takes over.
  */
 function drush_error_handler($errno, $message, $filename, $line, $context) {
-  // If the @ error suppression operator was used, error_reporting will have
-  // been temporarily set to 0.
-  if (error_reporting() == 0) {
-    return;
+	// E_DEPRECATED was added in PHP 5.3. Drupal 6 will not fix all the
+	// deprecated errors, but suppresses them. So we suppress them as well.
+    if (defined('E_DEPRECATED')) {
+    $errno = $errno & ~E_DEPRECATED;
   }
 
-  if ($errno & (E_ALL)) {
+   // "error_reporting" is usually set in php.ini, but may be changed by
+   // drush_errors_on() and drush_errors_off().
+  if ($errno & error_reporting()) {
     // By default we log notices.
     $type = drush_get_option('php-notices', 'notice');
 
-- 
1.7.5.1

