diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-08-11 09:53:44 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-08-11 09:53:44 +0000 |
| commit | 13ee49d316804e300aab638c020456873751e551 (patch) | |
| tree | 5948724bec9b79865cb013b3c6f660f1ccdc8a75 /usr.bin/sed | |
| parent | 6854d13abccf799999fbdb6d583493d02bf2e900 (diff) | |
Notes
Diffstat (limited to 'usr.bin/sed')
| -rw-r--r-- | usr.bin/sed/process.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index e7abf71c2d0c..94c24e9f0352 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -137,7 +137,7 @@ redirect: if (pd) goto new; if (psl == 0 || - (p = memchr(ps, '\n', psl - 1)) == NULL) { + (p = memchr(ps, '\n', psl)) == NULL) { pd = 1; goto new; } else { @@ -176,11 +176,8 @@ redirect: case 'N': flush_appends(); cspace(&PS, "\n", 1, 0); - if (!mf_fgets(&PS, 0)) { - if (!nflag && !pd) - OUT(ps) + if (!mf_fgets(&PS, 0)) exit(0); - } break; case 'p': if (pd) @@ -191,7 +188,7 @@ redirect: if (pd) break; if (psl != 0 && - (p = memchr(ps, '\n', psl - 1)) != NULL) { + (p = memchr(ps, '\n', psl)) != NULL) { oldpsl = psl; psl = p - ps; } |
