summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2008-10-09 10:58:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2008-10-09 10:58:33 +0000
commit8dfbcc107ae8fa03ae248651853ef29d251a3e86 (patch)
tree90f1233c5c627a69febbec01f0f0c3fc25574414 /usr.bin
parent16129ea4d43f99593173b07f43573d6563d22d86 (diff)
Don't strip newline when reading lines; matches the original behavior.
From otto@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sed/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 63c2a6ae795..f1ef6e0713f 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 2008/10/08 17:26:47 millert Exp $ */
+/* $OpenBSD: main.c,v 1.14 2008/10/09 10:58:32 millert Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -38,7 +38,7 @@ static const char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
/* from: static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94"; */
-static const char rcsid[] = "$OpenBSD: main.c,v 1.13 2008/10/08 17:26:47 millert Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.14 2008/10/09 10:58:32 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -196,8 +196,6 @@ again:
case ST_FILE:
if ((p = fgetln(f, &len)) != NULL) {
linenum++;
- if (len > 0 && p[len-1] == '\n')
- len--;
if (len >= *outlen) {
do {
*outlen *= 2;