From 9ab2858c5a9fe3bee998f3345528e9e48651c38a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 6 Jun 2004 19:32:15 +0000 Subject: [PATCH] * Cleaned up a couple of FIXME's sitting around in the code * Altered the conditions under which stray http://... strings are automatically turned into links, to prevent that logic from transforming IMG tags into gibberish. * Set internal version number to 5.21 --- webcit/ChangeLog | 8 ++++++++ webcit/html2html.c | 19 +++++++------------ webcit/messages.c | 18 ++++++++++-------- webcit/setup.c | 1 - webcit/webcit.h | 12 ++++++++++-- 5 files changed, 35 insertions(+), 23 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index a7370a269..74a31e524 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,11 @@ $Log$ +Revision 510.15 2004/06/06 19:32:15 ajc +* Cleaned up a couple of FIXME's sitting around in the code +* Altered the conditions under which stray http://... strings are + automatically turned into links, to prevent that logic from + transforming IMG tags into gibberish. +* Set internal version number to 5.21 + Revision 510.14 2004/06/04 02:29:07 ajc * Fixed bug in "validate new users" screen (thanks Campy) @@ -1862,3 +1869,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/html2html.c b/webcit/html2html.c index a4931be33..fdab14556 100644 --- a/webcit/html2html.c +++ b/webcit/html2html.c @@ -44,7 +44,6 @@ void output_html(void) { int output_length = 0; char new_window[SIZ]; int brak = 0; - int in_link = 0; int i; int linklen; @@ -136,8 +135,10 @@ void output_html(void) { ptr = &ptr[8]; ++brak; } - /* Turn anything that looks like a URL into a real link */ - else if ( (in_link == 0) + /* Turn anything that looks like a URL into a real link, as long + * as it's not inside a tag already + */ + else if ( (brak == 0) && (!strncasecmp(ptr, "http://", 7))) { linklen = 0; /* Find the end of the link */ @@ -175,16 +176,10 @@ void output_html(void) { } else { /* - * We need to know when we're inside a pair of ... - * tags, so we don't turn things that look like URL's into - * links, when they're already links. + * We need to know when we're inside a tag, + * so we don't turn things that look like URL's into + * links, when they're already links - or image sources. */ - if (!strncasecmp(ptr, "') --brak; converted_msg[output_length] = *ptr++; diff --git a/webcit/messages.c b/webcit/messages.c index a8dfeebde..c2aaa7173 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -932,8 +932,10 @@ int load_msg_ptrs(char *servcmd) { char buf[SIZ]; int nummsgs; + int maxload = 0; nummsgs = 0; + maxload = sizeof(WC->msgarr) / sizeof(long) ; serv_puts(servcmd); serv_gets(buf); if (buf[0] != '1') { @@ -941,9 +943,10 @@ int load_msg_ptrs(char *servcmd) return (nummsgs); } while (serv_gets(buf), strcmp(buf, "000")) { - WC->msgarr[nummsgs] = atol(buf); - /* FIXME check for overflow */ - ++nummsgs; + if (nummsgs < maxload) { + WC->msgarr[nummsgs] = atol(buf); + ++nummsgs; + } } return (nummsgs); } @@ -994,14 +997,13 @@ void readloop(char *oper) strcpy(cmd, "MSGS ALL"); } - /* FIXME put in the correct constant #defs */ - if ((WC->wc_view == 1) && (maxmsgs > 1)) { + if ((WC->wc_view == VIEW_MAILBOX) && (maxmsgs > 1)) { is_summary = 1; strcpy(cmd, "MSGS ALL"); maxmsgs = 32767; } - if ((WC->wc_view == 2) && (maxmsgs > 1)) { + if ((WC->wc_view == VIEW_ADDRESSBOOK) && (maxmsgs > 1)) { is_addressbook = 1; strcpy(cmd, "MSGS ALL"); maxmsgs = 32767; @@ -1040,12 +1042,12 @@ void readloop(char *oper) wprintf("
\n"); } - if (WC->wc_view == 3) { /* calendar */ + if (WC->wc_view == VIEW_CALENDAR) { /* calendar */ is_calendar = 1; strcpy(cmd, "MSGS ALL"); maxmsgs = 32767; } - if (WC->wc_view == 4) { /* tasks */ + if (WC->wc_view == VIEW_TASKS) { /* tasks */ is_tasks = 1; strcpy(cmd, "MSGS ALL"); maxmsgs = 32767; diff --git a/webcit/setup.c b/webcit/setup.c index d37f983e3..4478728c6 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -386,7 +386,6 @@ void check_inittab_entry(void) char looking_for[SIZ]; char question[SIZ]; char entryname[5]; - char entryname2[5]; char http_port[128]; char https_port[128]; char hostname[128]; diff --git a/webcit/webcit.h b/webcit/webcit.h index e94d0efcf..dec7db575 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -33,10 +33,10 @@ #define SLEEPING 180 /* TCP connection timeout */ #define WEBCIT_TIMEOUT 900 /* WebCit session timeout */ #define PORT_NUM 2000 /* port number to listen on */ -#define SERVER "WebCit v5.20" /* who's in da house */ +#define SERVER "WebCit v5.21" /* who's in da house */ #define DEVELOPER_ID 0 #define CLIENT_ID 4 -#define CLIENT_VERSION 520 /* This version of WebCit */ +#define CLIENT_VERSION 521 /* This version of WebCit */ #define MINIMUM_CIT_VERSION 611 /* min required Citadel vers */ #define DEFAULT_HOST "localhost" /* Default Citadel server */ #define DEFAULT_PORT "504" @@ -468,3 +468,11 @@ int client_read_ssl(char *buf, int bytes, int timeout); void client_write_ssl(char *buf, int nbytes); #endif + + +/* Views (from citadel.h) */ +#define VIEW_BBS 0 /* Traditional Citadel BBS view */ +#define VIEW_MAILBOX 1 /* Mailbox summary */ +#define VIEW_ADDRESSBOOK 2 /* Address book view */ +#define VIEW_CALENDAR 3 /* Calendar view */ +#define VIEW_TASKS 4 /* Tasks view */ -- 2.30.2