Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.617.2.17
diff -u -p -r1.617.2.17 comment.module
--- modules/comment/comment.module	11 Aug 2010 20:35:47 -0000	1.617.2.17
+++ modules/comment/comment.module	17 Sep 2010 14:09:06 -0000
@@ -1798,19 +1798,19 @@ function theme_comment_post_forbidden($n
       // We cannot use drupal_get_destination() because these links
       // sometimes appear on /node and taxonomy listing pages.
       if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
-        $destination = 'destination='. rawurlencode("comment/reply/$node->nid#comment-form");
+        $destination = 'destination='. rawurlencode("comment/reply/$node->nid");
       }
       else {
-        $destination = 'destination='. rawurlencode("node/$node->nid#comment-form");
+        $destination = 'destination='. rawurlencode("node/$node->nid");
       }
 
       if (variable_get('user_register', 1)) {
         // Users can register themselves.
-        return t('<a href="@login">Login</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination))));
+        return t('<a href="@login">Login</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', array('query' => $destination, 'fragment' => 'comment-form')), '@register' => url('user/register', array('query' => $destination, 'fragment' => 'comment-form'))));
       }
       else {
         // Only admins can add new users, no public registration.
-        return t('<a href="@login">Login</a> to post comments', array('@login' => url('user/login', array('query' => $destination))));
+        return t('<a href="@login">Login</a> to post comments', array('@login' => url('user/login', array('query' => $destination, 'fragment' => 'comment-form'))));
       }
     }
   }
