]> code.citadel.org Git - citadel.git/blobdiff - webcit/serv_func.c
* text_to_server() now behaves the way web users expect text entry to work.
[citadel.git] / webcit / serv_func.c
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;