]> err.no Git - util-linux/commitdiff
login-utils: remove unwanted newlines from wall
authorKarel Zak <kzak@redhat.com>
Mon, 16 Jul 2007 12:41:28 +0000 (14:41 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Jul 2007 12:52:18 +0000 (14:52 +0200)
Prevent wall from adding an empty newline to every new line.

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/wall.c

index 2797f4651cc03be27ba6878236173fae9b5dadd3..c9893d7e4565965ade52c41a1fe944daa76d185a 100644 (file)
@@ -221,7 +221,8 @@ makemsg(fname)
                                putc('\n', fp);
                                cnt = 0;
                        }
-                       carefulputc(ch, fp);
+                       if (ch != '\n')
+                               carefulputc(ch, fp);
                }
        }
        fprintf(fp, "%79s\r\n", " ");