Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 5177)
+++ wp-includes/link-template.php	(working copy)
@@ -168,7 +168,7 @@
 		else
 			$parentlink = get_permalink( $object->post_parent );
 		if (strpos($parentlink, '?') === false)
-			$link = trim($parentlink, '/') . '/' . $object->post_name . '/';
+			$link = rtrim($parentlink, '/') . '/' . $object->post_name . '/';
 	}
 
 	if (! $link ) {

