From 3dee67070586fd86c837548c975b9259ad3fb1c7 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 31 Mar 2000 03:48:52 +0000 Subject: [PATCH] * text_to_server() now behaves the way web users expect text entry to work. Soft linebreaks are soft, hard linebreaks are hard. No indentation. --- webcit/ChangeLog | 5 +++++ webcit/messages.c | 4 ---- webcit/serv_func.c | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index f42ca7d41..bcfb91552 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 211.11 2000/03/31 03:48:52 ajc +* text_to_server() now behaves the way web users expect text entry to work. + Soft linebreaks are soft, hard linebreaks are hard. No indentation. + Revision 211.10 2000/03/31 02:39:06 ajc * Fixed bugs in "Site configuration" and added new fields. @@ -408,3 +412,4 @@ 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 c2b98d37e..764756011 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -439,10 +439,6 @@ void display_enter(void) wprintf("%s
\n", &buf[4]); goto DONE; } - wprintf("
Enter message below. Messages are formatted to\n"); - wprintf("the reader's screen width. To defeat the\n"); - wprintf("formatting, indent a line at least one space. \n"); - wprintf("
"); now = time(NULL); tm = (struct tm *) localtime(&now); diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 2ee6b39f0..38b4fdd80 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -162,10 +162,12 @@ void text_to_server(char *ptr) while (ptr[pos] != 0) { ch = ptr[pos++]; if (ch == 10) { - while (isspace(buf[strlen(buf) - 1])) + while ( (isspace(buf[strlen(buf) - 1])) + && (strlen(buf) > 1) ) buf[strlen(buf) - 1] = 0; serv_puts(buf); strcpy(buf, ""); + if (ptr[pos] != 0) strcat(buf, " "); } else { a = strlen(buf); buf[a + 1] = 0; -- 2.39.2