diff --git a/commands/pm/pm.drush.inc b/commands/pm/pm.drush.inc
index 8cdebb5..91d93b2 100644
--- a/commands/pm/pm.drush.inc
+++ b/commands/pm/pm.drush.inc
@@ -1070,17 +1070,25 @@ function _pm_find_common_path($project_type, $extensions) {
       if ($path == $path2) {
         continue;
       }
-      // Option 2: $path is a prefix of $path2.
+      // Option 2a: null path.
+      if ($path == '') {
+        $path = $path2;
+      }
+      // Option 2b: null path2.
+      if ($path2 == '') {
+        $path2 = $path;
+      }
+      // Option 3: $path is a prefix of $path2.
       if (strpos($path2, $path) === 0) {
         continue;
       }
-      // Option 3: $path2 is a prefix of $path.
+      // Option 4: $path2 is a prefix of $path.
       if (strpos($path, $path2) === 0) {
         $path = $path2;
         continue;
       }
-      // Option 4: no one is a prefix of the other. Find the common
-      // prefix by iteratively strip the rigthtmost piece of $path.
+      // Option 5: no one is a prefix of the other. Find the common
+      // prefix by iteratively strip the rightmost piece of $path.
       // We will iterate until a prefix is found or path = '.', that on the
       // other hand is a condition theorically impossible to reach.
       do {
