From 584f3a15eadcca708f1e980aa0e8f7ad0a323666 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 7 Oct 2008 21:51:38 +0000 Subject: The 'l' command should not encode newlines. Also document that backspace is escaped as \b. OK phessler@ and jmc@ --- usr.bin/sed/process.c | 10 +++++----- usr.bin/sed/sed.1 | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'usr.bin/sed') diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 9d83e6d0c56..8c898647e45 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process.c,v 1.13 2006/10/09 00:23:57 tedu Exp $ */ +/* $OpenBSD: process.c,v 1.14 2008/10/07 21:51:37 millert Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)process.c 8.1 (Berkeley) 6/6/93"; */ -static const char rcsid[] = "$OpenBSD: process.c,v 1.13 2006/10/09 00:23:57 tedu Exp $"; +static const char rcsid[] = "$OpenBSD: process.c,v 1.14 2008/10/07 21:51:37 millert Exp $"; #endif /* not lint */ #include @@ -481,11 +481,11 @@ lputs(char *s) if (isascii(*s) && isprint(*s) && *s != '\\') { (void)putchar(*s); count++; - } else { - escapes = "\\\a\b\f\n\r\t\v"; + } else if (*s != '\n') { + escapes = "\\\a\b\f\r\t\v"; (void)putchar('\\'); if ((p = strchr(escapes, *s))) { - (void)putchar("\\abfnrtv"[p - escapes]); + (void)putchar("\\abfrtv"[p - escapes]); count += 2; } else { (void)printf("%03o", *(u_char *)s); diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index 0083356051b..f1bda6e4004 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sed.1,v 1.30 2008/09/01 06:13:14 jmc Exp $ +.\" $OpenBSD: sed.1,v 1.31 2008/10/07 21:51:37 millert Exp $ .\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\" .\" from: @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" -.Dd $Mdocdate: September 1 2008 $ +.Dd $Mdocdate: October 7 2008 $ .Dt SED 1 .Os .Sh NAME @@ -336,10 +336,10 @@ This form is as follows: \e\e .It alert \ea +.It backspace +\eb .It form-feed \ef -.It newline -\en .It carriage-return \er .It tab -- cgit v1.2.3