--- modules/comment/comment.module.orig	2010-05-28 19:23:15.000000000 +0300
+++ modules/comment/comment.module	2010-06-23 16:52:06.821759915 +0300
@@ -1798,19 +1798,19 @@
       // 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'))));
       }
     }
   }
