From f96067856317189504d45b0b93a85166c77ef25b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 30 Mar 2003 06:13:19 +0000 Subject: [PATCH] * When reading from the server, do not treat CR as end-of-line because there's probably an LF coming after it. Instead, keep reading to the LF and then strip both. * No not underline links in the icon bars --- webcit/ChangeLog | 9 +++++++++ webcit/messages.c | 2 ++ webcit/static/head.html | 1 + webcit/static/iconbar.html | 7 +++++++ webcit/static/navbar.html | 7 +++++++ webcit/tcp_sockets.c | 5 +++-- 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 9705c718b..465b98dcc 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,10 @@ $Log$ +Revision 410.7 2003/03/30 06:13:19 ajc +* When reading from the server, do not treat CR as end-of-line because + there's probably an LF coming after it. Instead, keep reading to the LF + and then strip both. +* No not underline links in the icon bars + Revision 410.6 2003/03/17 04:17:41 ajc * Call to accept() was being made with an uninitialized variable for the third argument. Changed the second and third argument to NULL and 0 because @@ -1306,3 +1312,6 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + + + diff --git a/webcit/messages.c b/webcit/messages.c index 17eaeb9ab..9832741fb 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -428,6 +428,8 @@ void read_message(long msgnum) { /* Boring old 80-column fixed format text gets handled this way... */ else if (!strcasecmp(mime_content_type, "text/plain")) { while (serv_gets(buf), strcmp(buf, "000")) { + if (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = 0; + if (buf[strlen(buf)-1] == '\r') buf[strlen(buf)-1] = 0; while ((strlen(buf) > 0) && (isspace(buf[strlen(buf) - 1]))) buf[strlen(buf) - 1] = 0; if ((bq == 0) && diff --git a/webcit/static/head.html b/webcit/static/head.html index b7442df20..8e59da96d 100644 --- a/webcit/static/head.html +++ b/webcit/static/head.html @@ -4,6 +4,7 @@ + diff --git a/webcit/static/iconbar.html b/webcit/static/iconbar.html index 92e39e294..73da163f9 100644 --- a/webcit/static/iconbar.html +++ b/webcit/static/iconbar.html @@ -1,4 +1,11 @@ + + + diff --git a/webcit/static/navbar.html b/webcit/static/navbar.html index cc2b544a5..75a2a2f7f 100644 --- a/webcit/static/navbar.html +++ b/webcit/static/navbar.html @@ -1,4 +1,11 @@ + + +
diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 9c32b7158..37eaa2987 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -166,8 +166,9 @@ void serv_gets(char *strbuf) serv_read(&buf[0], 1); ch = buf[0]; strbuf[len++] = ch; - } while ((ch != 10) && (ch != 13) && (ch != 0) && (len < 255)); - strbuf[len - 1] = 0; + } while ((ch != 10) && (ch != 0) && (len < (SIZ-1))); + if (strbuf[len-1] == 10) strbuf[--len] = 0; + if (strbuf[len-1] == 13) strbuf[--len] = 0; /* lprintf(9, ">%s\n", strbuf); */ } -- 2.39.2