--- src/init.c.distro	2005-08-08 18:54:16.000000000 -0400
+++ src/init.c	2007-09-12 16:01:49.000000000 -0400
@@ -299,6 +299,7 @@
 
   opt.read_timeout = 900;
   opt.use_robots = 1;
+  opt.useragent = xstrdup ("Wget");
 
   opt.remove_listing = 1;
 
--- src/res.c.distro	2005-06-19 09:47:10.000000000 -0400
+++ src/res.c	2007-09-12 16:47:43.000000000 -0400
@@ -110,12 +110,14 @@
 match_user_agent (const char *agent, int length,
 		  int *matches, int *exact_match)
 {
+  char *agent_copy;
+  BOUNDED_TO_ALLOCA (agent, agent + length, agent_copy); /* terminated copy of UA string from robots.txt */
   if (length == 1 && *agent == '*')
     {
       *matches = 1;
       *exact_match = 0;
     }
-  else if (BOUNDED_EQUAL_NO_CASE (agent, agent + length, "wget"))
+  else if (strcasecmp(agent_copy, opt.useragent)==0)
     {
       *matches = 1;
       *exact_match = 1;
@@ -125,6 +127,9 @@
       *matches = 0;
       *exact_match = 0;
     }
+  DEBUGP (( "%s of '%s' against useragent '%s'.\n", 
+            (*matches ? (*exact_match ? "EXACT-MATCH" : "MATCH" ) : "MISMATCH"), 
+            agent_copy, opt.useragent ));
 }
 
 /* Add a path specification between PATH_B and PATH_E as one of the
@@ -285,7 +290,7 @@
       SKIP_SPACE (p);
       if (field_b == field_e || EOL (p) || *p != ':')
 	{
-	  DEBUGP (("Ignoring malformed line %d", line_count));
+	  DEBUGP (("Ignoring malformed line %d\n", line_count));
 	  goto next;
 	}
       ++p;			/* skip ':' */
@@ -354,7 +359,7 @@
 	}
       else
 	{
-	  DEBUGP (("Ignoring unknown field at line %d", line_count));
+	  DEBUGP (("Ignoring unknown field at line %d\n", line_count));
 	  goto next;
 	}
 
