comparison src/scanner.cpp @ 17:b6a4b72bb96e

add scanning for bare hostnames
author carl
date Thu, 29 Apr 2004 22:05:03 -0700
parents 2ae8d953f1d0
children 041ea016b684
comparison
equal deleted inserted replaced
16:2ae8d953f1d0 17:b6a4b72bb96e
880 880
881 ////////////////////////////// 881 //////////////////////////////
882 // host name recognizer 882 // host name recognizer
883 case h_end: { 883 case h_end: {
884 count--; 884 count--;
885 pending[count] = 0;
885 char *tld; 886 char *tld;
886 for (int i=0; (tld = tlds[i]); i++) { 887 for (int i=0; (tld = tlds[i]); i++) {
887 int n = strlen(tld); 888 int n = strlen(tld);
888 if (count > n) { 889 if (count > n) {
889 if (strncasecmp((const char *)(pending+count-n), tld, n) == 0) { 890 if (strncasecmp((const char *)(pending+count-n), tld, n) == 0) {
890 register_string(*hosts, (char*)pending); 891 register_string(*hosts, (char*)pending);
892 break;
891 } 893 }
892 } 894 }
893 } 895 }
894 } // fall thru 896 } // fall thru
895 897