From 98aa149b31a7845e8d1f7935bdb2b28e695a85d6 Mon Sep 17 00:00:00 2001 From: tjr Date: Sat, 22 Jun 2002 03:00:52 +0000 Subject: Now that the pattern space contains no trailing newline, modify the `l' command's output so it's the same as what SUSv3 specifies. --- usr.bin/sed/process.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.bin/sed') 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))) { -- cgit v1.1