diff --git a/docroot/sites/all/modules/contrib/drush_ctex_bonus/drush_ctex_bonus.drush.inc b/docroot/sites/all/modules/contrib/drush_ctex_bonus/drush_ctex_bonus.drush.inc
index 8ad9bec..8ce707e 100644
--- a/docroot/sites/all/modules/contrib/drush_ctex_bonus/drush_ctex_bonus.drush.inc
+++ b/docroot/sites/all/modules/contrib/drush_ctex_bonus/drush_ctex_bonus.drush.inc
@@ -2469,3 +2469,22 @@ function _drush_ctex_bonus_preflight_backup_dir($subdir = NULL) {
 
   return $backup_dir;
 }
+
+// Add support for Drush 4.6-5.0 as the drush_trim_path does not exist in
+// that codebase.
+if (!function_exists('drush_trim_path')) {
+
+/**
+ * Remove the trailing DIRECTORY_SEPARATOR from a path.
+ * Will actually remove either / or \ on Windows.
+ */
+function drush_trim_path($path, $os = NULL) {
+  if (drush_is_windows($os)) {
+    return rtrim($path, '/\\');
+  }
+  else {
+    return rtrim($path, '/');
+  }
+}
+
+}
