Index: modules/comment.module
===================================================================
--- modules/comment.module	(revision 5751)
+++ modules/comment.module	(working copy)
@@ -1558,10 +1558,10 @@
   }
   else {
     if (variable_get('user_register', 1)) {
-      return t('<a href="%login">login</a> or <a href="%register">register</a> to post comments', array('%login' => url('user/login'), '%register' => url('user/register')));
+      return t('<a href="%login">login</a> or <a href="%register">register</a> to post comments', array('%login' => url('user/login', drupal_get_destination() .  urlencode('#comment-form')), '%register' => url('user/register', drupal_get_destination() . urlencode('#comment-form'))));
     }
     else {
-      return t('<a href="%login">login</a> to post comments', array('%login' => url('user/login')));
+      return t('<a href="%login">login</a> to post comments', array('%login' => url('user/login', drupal_get_destination() . urlencode('#comment-form'))));
     }
   }
 }
