[w3m-dev 04134] schemetable is broken
Kiyokazu SUTO <[email protected]> 21 Jan 2005 21:51:54 +0900
| Newsgroups | gmane.comp.web.w3m.devel |
|---|---|
| Message-ID | <[email protected]> |
2ch: http://pc5.2ch.net/test/read.cgi/unix/1087225153/959-969 #ifdef INET6 # make -- <[email protected]> http://pub.ks-and-ks.ne.jp/pgp-public-key.html Index: url.c =================================================================== RCS file: /cvsroot/w3m/w3m/url.c,v retrieving revision 1.89 diff -u -r1.89 url.c --- url.c 16 Apr 2004 18:47:19 -0000 1.89 +++ url.c 21 Jan 2005 12:46:37 -0000 @@ -67,21 +67,28 @@ #endif /* USE_SSL */ }; -struct cmdtable schemetable[] = { +static struct cmdtable schemetable[] = { {"http", SCM_HTTP}, {"gopher", SCM_GOPHER}, {"ftp", SCM_FTP}, {"local", SCM_LOCAL}, {"file", SCM_LOCAL}, /* {"exec", SCM_EXEC}, */ + {"", SCM_EXEC}, {"nntp", SCM_NNTP}, /* {"nntp", SCM_NNTP_GROUP}, */ + {"", SCM_NNTP_GROUP}, {"news", SCM_NEWS}, /* {"news", SCM_NEWS_GROUP}, */ + {"", SCM_NEWS_GROUP}, {"data", SCM_DATA}, -#ifndef USE_W3MMAILER - {"mailto", SCM_MAILTO}, + { +#ifdef USE_W3MMAILER + "" +#else + "mailto" #endif + , SCM_MAILTO}, #ifdef USE_SSL {"https", SCM_HTTPS}, #endif /* USE_SSL */ @@ -1255,11 +1262,13 @@ if (*p == ':') { /* scheme found */ scheme = SCM_UNKNOWN; for (i = 0; (q = schemetable[i].cmdname) != NULL; i++) { - int len = strlen(q); - if (!strncasecmp(q, *url, len) && (*url)[len] == ':') { - scheme = schemetable[i].cmd; - *url = p + 1; - break; + if (*q) { + int len = strlen(q); + if (!strncasecmp(q, *url, len) && (*url)[len] == ':') { + scheme = schemetable[i].cmd; + *url = p + 1; + break; + } } } }