summaryrefslogtreecommitdiff
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2008-10-07 21:51:38 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2008-10-07 21:51:38 +0000
commit584f3a15eadcca708f1e980aa0e8f7ad0a323666 (patch)
treedfb683148c8eabd0a353d14ba72b755727193426 /usr.bin/sed
parentb272cb1d48e86c802db4d709c84cdc06f3ec6ac7 (diff)
The 'l' command should not encode newlines. Also document that
backspace is escaped as \b. OK phessler@ and jmc@
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/process.c10
-rw-r--r--usr.bin/sed/sed.18
2 files changed, 9 insertions, 9 deletions
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 <sys/types.h>
@@ -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