diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2007-10-05 14:39:40 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2007-10-05 14:39:40 +0000 |
commit | 899d695843e33252da85dcbe136c7cb1e49a85be (patch) | |
tree | d66e7225575181f581abb758a0956cc7f201994a /usr.bin/mail/fio.c | |
parent | 63eb2ad70423829314bc396c95a9053f4a001eca (diff) |
check if it's really a newline before removing it
with the help of ray@ "Looks OK" millert@
Diffstat (limited to 'usr.bin/mail/fio.c')
-rw-r--r-- | usr.bin/mail/fio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index dd99ce2c9f1..e621bf953a7 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fio.c,v 1.29 2007/09/10 14:29:53 tobias Exp $ */ +/* $OpenBSD: fio.c,v 1.30 2007/10/05 14:39:39 chl Exp $ */ /* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static const char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95"; #else -static const char rcsid[] = "$OpenBSD: fio.c,v 1.29 2007/09/10 14:29:53 tobias Exp $"; +static const char rcsid[] = "$OpenBSD: fio.c,v 1.30 2007/10/05 14:39:39 chl Exp $"; #endif #endif /* not lint */ @@ -132,7 +132,7 @@ setptr(FILE *ibuf, off_t offset) (void)fwrite(linebuf, sizeof(*linebuf), count, otf); if (ferror(otf)) err(1, "/tmp"); - if (count) + if (count && linebuf[count - 1] == '\n') linebuf[count - 1] = '\0'; if (maybe && linebuf[0] == 'F' && ishead(linebuf)) { msgCount++; |