summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-22 03:00:52 +0000
committertjr <tjr@FreeBSD.org>2002-06-22 03:00:52 +0000
commit98aa149b31a7845e8d1f7935bdb2b28e695a85d6 (patch)
tree7174e3cc93b752e21ad3b1f6e138b3c60b9c9361 /usr.bin/sed
parent8284d4b7d0c035d0f09495ffe670c7ef3d98eebe (diff)
downloadFreeBSD-src-98aa149b31a7845e8d1f7935bdb2b28e695a85d6.zip
FreeBSD-src-98aa149b31a7845e8d1f7935bdb2b28e695a85d6.tar.gz
Now that the pattern space contains no trailing newline, modify the `l'
command's output so it's the same as what SUSv3 specifies.
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/process.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 6c14631..17f543d 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -491,7 +491,11 @@ lputs(s)
if (isprint((unsigned char)*s) && *s != '\\') {
(void)putchar(*s);
count++;
- } else if (*s != '\n') {
+ } else if (*s == '\n') {
+ (void)putchar('$');
+ (void)putchar('\n');
+ count = 0;
+ } else {
escapes = "\\\a\b\f\r\t\v";
(void)putchar('\\');
if ((p = strchr(escapes, *s))) {
OpenPOWER on IntegriCloud