remove trailing spaces properly! R_1_39a
authordjk <djk>
Tue, 28 Mar 2000 22:37:54 +0000 (22:37 +0000)
committerdjk <djk>
Tue, 28 Mar 2000 22:37:54 +0000 (22:37 +0000)
src/client.c

index 5258e39d8163860543b8c1d6a0fef5ae14e48da1..fb7e5c137ccd12711061bf054882eb8f193a4e05 100644 (file)
@@ -212,6 +212,10 @@ void send_text(fcb_t *f, char *s, int l)
                f->obuf = mp = cmsg_new(paclen+1, f->sort, f);
        }
 
+       /* ignore trailing spaces  */
+       while (l > 0 &&isspace(s[l-1]))
+               --l;
+
        for (p = s; p < s+l; ) {
                if (mp->inp >= mp->data + paclen) {
                        flush_text(f);