Index: includes/environment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/environment.inc,v
retrieving revision 1.44
diff -u -u -p -r1.44 environment.inc
--- includes/environment.inc	1 Oct 2009 17:24:00 -0000	1.44
+++ includes/environment.inc	4 Oct 2009 04:43:59 -0000
@@ -713,7 +713,8 @@ function _drush_shift_path_up($path) {
  * Like Drupal conf_path, but searching from beneath.
  * Allows proper site uri detection in site sub-directories.
  *
- * Essentially looks for a settings.php file.
+ * Essentially looks for a settings.php file that is within a directory
+ * whose parent directory is named "sites".
  *
  * @param string
  *   Search starting path. Defaults to current working directory.
@@ -729,13 +730,13 @@ function drush_site_path($path = NULL) {
 
     $path = empty($path) ? drush_cwd() : $path;
     // Check the current path.
-    if (file_exists($path . '/settings.php')) {
+    if (file_exists($path . '/settings.php') && basename(dirname($path)) == 'sites') {
       $site_path = $path;
     }
     else {
       // Move up dir by dir and check each.
       while ($path = _drush_shift_path_up($path)) {
-        if (file_exists($path . '/settings.php')) {
+        if (file_exists($path . '/settings.php') && basename(dirname($path)) == 'sites') {
           $site_path = $path;
           break;
         }
