]> mj.ucw.cz Git - libucw.git/commitdiff
When killing dots at the end of host name, remove _all_ of them, not just
authorMartin Mares <mj@ucw.cz>
Sun, 5 Jan 2003 11:32:02 +0000 (11:32 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 5 Jan 2003 11:32:02 +0000 (11:32 +0000)
the last one. Without this, url_canonicalize on already believed to be
canonic names wasn't constant which causes havoc in gatherd.

lib/url.c

index 0f4a50195570bb7cf198b8d6aa0b5342a2579cd4..65f1c0aad8feb297a6314644521de597fcfa8894 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -416,8 +416,8 @@ kill_end_dot(byte *b)
   if (b)
     {
       k = b + strlen(b) - 1;
-      if (k > b && *k == '.')
-       *k = 0;
+      while (k > b && *k == '.')
+       *k-- = 0;
     }
 }