# HG changeset patch # User carl # Date 1154454295 25200 # Node ID e316f6fd9c39e7bfa0156cc117e1d66060b2f884 # Parent c5cd1261394de236d66e50b1234741052b4ee7e5 uribl lookups fully qualified; allow two component host names diff -r c5cd1261394d -r e316f6fd9c39 src/scanner.cpp --- a/src/scanner.cpp Tue Jun 06 08:45:07 2006 -0700 +++ b/src/scanner.cpp Tue Aug 01 10:44:55 2006 -0700 @@ -1203,15 +1203,16 @@ } void fsa::validhost () { - // remove trailing dot - if (pending[count-1]== '.') pending[--count] = '\0'; + // remove trailing periods + while (count && (pending[count-1]== '.')) pending[--count] = '\0'; + if (!count) return; // empty string if (!strchr((const char *)pending, '@')) { // not an email address or message id char *p1 = strchr((const char *)pending, '.'); char *p2 = strrchr((const char *)pending, '.'); char *p3 = strstr((const char *)pending, ".."); - if (p1 && (p1 != p2) & !p3) { - // have two periods, so at least three components, and no empty components + if (p1 && (p1 != pending) & !p3) { + // have a period, so at least two components, and no empty components in_addr ip; if (inet_aton((const char*)pending, &ip)) memory->new_url((char*)pending);