diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2008-10-09 10:58:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2008-10-09 10:58:33 +0000 |
commit | 8dfbcc107ae8fa03ae248651853ef29d251a3e86 (patch) | |
tree | 90f1233c5c627a69febbec01f0f0c3fc25574414 | |
parent | 16129ea4d43f99593173b07f43573d6563d22d86 (diff) |
Don't strip newline when reading lines; matches the original behavior.
From otto@
-rw-r--r-- | usr.bin/sed/main.c | 6 |
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; |