]> code.citadel.org Git - citadel.git/commitdiff
* text_to_server() now behaves the way web users expect text entry to work.
authorArt Cancro <ajc@citadel.org>
Fri, 31 Mar 2000 03:48:52 +0000 (03:48 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 31 Mar 2000 03:48:52 +0000 (03:48 +0000)
  Soft linebreaks are soft, hard linebreaks are hard.  No indentation.

webcit/ChangeLog
webcit/messages.c
webcit/serv_func.c

index f42ca7d41bbdd832c066173994890ce8fa2de1d2..bcfb915521dafaad7a7733d8909b994a6c697442 100644 (file)
@@ -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 <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index c2b98d37e8a93b5b29fe8c1e3f6caee7f95866ed..764756011619fcf758b2715f809bfdddd1dcc401 100644 (file)
@@ -439,10 +439,6 @@ void display_enter(void)
                wprintf("<EM>%s</EM><BR>\n", &buf[4]);
                goto DONE;
        }
-       wprintf("<CENTER>Enter message below.  Messages are formatted to\n");
-       wprintf("the <EM>reader's</EM> screen width.  To defeat the\n");
-       wprintf("formatting, indent a line at least one space.  \n");
-       wprintf("<BR>");
 
        now = time(NULL);
        tm = (struct tm *) localtime(&now);
index 2ee6b39f0b6daf7993c70ce50243654b21abdc37..38b4fdd80c18069c9f8954a9c9426b793985b92e 100644 (file)
@@ -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;