diff -urN --exclude=*~ --exclude=#* --exclude=Makefile.in --exclude=Makefile --exclude=configure --exclude=aclocal.m4 --exclude=.deps ../texinfo-4.0a/makeinfo/html.c ./makeinfo/html.c
--- ../texinfo-4.0a/makeinfo/html.c	Thu Dec 21 17:17:42 2000
+++ ./makeinfo/html.c	Tue Mar  6 11:22:26 2001
@@ -27,10 +27,14 @@
 /* See html.h.  */
 int html_output_head_p = 0;
 
+extern char *command_output_filename;
+
 void
 html_output_head ()
 {
   char *html_title;
+  char *p;
+  char base_name[PATH_MAX];
   
   if (html_output_head_p)
     return;
@@ -50,7 +54,33 @@
   add_word_args ("<meta name=description content=\"%s\">\n", html_title);
   add_word_args ("<meta name=generator content=\"makeinfo %s\">\n", VERSION);
   add_word ("<link href=\"http://texinfo.org/\" rel=generator-home>\n");
-  add_word ("</head><body>\n\n");
+  add_word ("</head><body>\n");
+  
+  /*
+    Some browsers really need to have all anchors defined, and
+   */
+  strcpy (base_name, basename (current_output_filename));
+  p = strchr (base_name, '.');
+  if (p)
+    {
+      *p = '\0';
+    }
+  add_word_args ("<a name=\"%s\">\n", base_name);
+  /*
+    Also, the Top node may be referred to with the top level input file
+    name as anchor, instead of 'index'.
+   */
+  if (command_output_filename)
+    {
+      strcpy (base_name, basename (command_output_filename));
+      p = strchr (base_name, '.');
+      if (p)
+	{
+	  *p = '\0';
+	}
+      add_word_args ("<a name=\"%s\">\n", base_name);
+    }
+  add_word ("\n");
 }
 
 
@@ -275,7 +305,17 @@
       p++;
       /* in the case of just (info-document), there will be nothing
          remaining, and we will refer to ../info-document/, which will
-         work fine. */
+         work fine. 
+       */
+      if (*p == '\0')
+        {
+#if 0
+	  p = "index";
+#else
+	  /* Otherwise, return here, otherwise we get `info-document/#.html' */
+	  return filename;
+#endif
+        }
     }
 
   strcat (filename, p);
diff -urN --exclude=*~ --exclude=#* --exclude=Makefile.in --exclude=Makefile --exclude=configure --exclude=aclocal.m4 --exclude=.deps ../texinfo-4.0a/makeinfo/makeinfo.c ./makeinfo/makeinfo.c
--- ../texinfo-4.0a/makeinfo/makeinfo.c	Tue Dec 19 17:56:54 2000
+++ ./makeinfo/makeinfo.c	Fri Jan 19 15:11:21 2001
@@ -1364,7 +1364,9 @@
         input_text_offset = 0;
 
       real_output_filename = output_filename = command_output_filename;
+#if 0
       command_output_filename = NULL;
+#endif
     }
 
   canon_white (output_filename);
diff -urN --exclude=*~ --exclude=#* --exclude=Makefile.in --exclude=Makefile --exclude=configure --exclude=aclocal.m4 --exclude=.deps ../texinfo-4.0a/makeinfo/toc.c ./makeinfo/toc.c
--- ../texinfo-4.0a/makeinfo/toc.c	Tue Dec 19 16:18:01 2000
+++ ./makeinfo/toc.c	Wed Dec 27 19:33:33 2000
@@ -235,8 +235,10 @@
           for (k = 0; k < (last_level-toc_entry_alist[i]->level); k++)
             fputs ("</ul>\n", fp);
         }
-
-      if (splitting)
+      /* No Top or double entries in toc */
+      if (splitting && strcasecmp (toc_entry_alist[i]->name, "Top")
+	  && i && strcmp (toc_entry_alist[i]->name,
+			  toc_entry_alist[i-1]->name))
 	{
 	  char *filename = nodename_to_filename (toc_entry_alist[i]->name);
 	  fprintf (fp, "<li><a href=\"%s\">%s</a>\n",
@@ -244,7 +246,7 @@
 		   toc_entry_alist[i]->name);
 	  free (filename);
 	}
-      else
+      else if (!splitting)
 	fprintf (fp, "<li><a href=\"#%s</a>\n", toc_entry_alist[i]->name);
 
       last_level = toc_entry_alist[i]->level;
@@ -309,7 +311,10 @@
     {
       if ((toc_entry_alist[i])->level == 0)
         {
-	  if (splitting)
+	  /* No Top or double entries in toc */
+	  if (splitting && strcasecmp (toc_entry_alist[i]->name, "Top")
+	      && i && strcmp (toc_entry_alist[i]->name,
+			      toc_entry_alist[i-1]->name))
 	    {
 	      char *filename = nodename_to_filename (toc_entry_alist[i]->name);
 	      fprintf (fp, "<li><a href=\"%s\">%s</a>\n",
@@ -317,7 +322,7 @@
 		   toc_entry_alist[i]->name);
 	      free (filename);
 	    }
-	  else
+	  else if (!splitting)
 	    {
 	      fputs ("<li>", fp);
 	      fprintf (fp, "<a href=\"#%s\n", toc_entry_alist[i]->name);

