Index: wp-includes/plugin.php
--- wp-includes/plugin.php Base (BASE)
+++ wp-includes/plugin.php Locally Modified (Based On LOCAL)
@@ -581,7 +581,29 @@
  * @return string the filesystem path of the directory that contains the plugin
  */
 function plugin_dir_path( $file ) {
-	return trailingslashit( dirname( $file ) );
+	$file          = str_replace(  '\\','/',   $file           ); // sanitize for Win32 installs
+	$file          = preg_replace( '|/+|','/', $file           ); // remove any duplicate slash
+	$plugin_dir    = str_replace(  '\\','/',   WP_PLUGIN_DIR   ); // sanitize for Win32 installs
+	$plugin_dir    = preg_replace( '|/+|','/', $plugin_dir     ); // remove any duplicate slash
+	$mu_plugin_dir = str_replace(  '\\','/',   WPMU_PLUGIN_DIR ); // sanitize for Win32 installs
+	$mu_plugin_dir = preg_replace( '|/+|','/', $mu_plugin_dir  ); // remove any duplicate slash
+
+	// Determine if plugin is in /plugins or /mu-plugins
+	if ( 0 === strpos( $file, $mu_plugin_dir ) )
+		$path = $mu_plugin_dir;
+	else
+		$path = $plugin_dir;
+
+	// Get relative path from plugins dir
+	$file = preg_replace( '#^' . preg_quote( $plugin_dir, '#' ) . '/|^' . preg_quote( $mu_plugin_dir, '#' ) . '/#', '', $file );
+	$file = trim( $file, '/' );
+
+	// Get the folder name and add it to the path
+	$folder = dirname( $file );
+	if ( '.' != $folder )
+		$path .= '/' . ltrim( $folder, '/' );
+
+	return trailingslashit( $path );
 }
 
 /**
