diff options
| author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2007-04-19 23:04:51 +0000 |
|---|---|---|
| committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2007-04-19 23:04:51 +0000 |
| commit | db937f2110bce910c29bfbe7dfada49a8f07a567 (patch) | |
| tree | 5409d071adfeb905d4548a3c35868121136820f8 | |
| parent | 0cc2eb761571e68f94b85510bba432d34c5066cc (diff) | |
Notes
| -rw-r--r-- | tools/regression/usr.bin/sed/regress.sh | 14 | ||||
| -rw-r--r-- | usr.bin/sed/process.c | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/regression/usr.bin/sed/regress.sh b/tools/regression/usr.bin/sed/regress.sh index cd68e240c492b..834f5bdcba415 100644 --- a/tools/regression/usr.bin/sed/regress.sh +++ b/tools/regression/usr.bin/sed/regress.sh @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..9' +echo '1..13' REGRESSION_TEST(`G', `sed G < regress.in') REGRESSION_TEST(`P', `sed P < regress.in') @@ -13,5 +13,17 @@ REGRESSION_TEST(`sg', `echo foo | sed s/,*/,/g') REGRESSION_TEST(`s3', `echo foo | sed s/,*/,/3') REGRESSION_TEST(`s4', `echo foo | sed s/,*/,/4') REGRESSION_TEST(`s5', `echo foo | sed s/,*/,/5') +REGRESSION_TEST(`c0', `sed ''`c\ +foo +''`< regress.in') +REGRESSION_TEST(`c1', `sed ''`4,$c\ +foo +''`< regress.in') +REGRESSION_TEST(`c2', `sed ''`3,9c\ +foo +''`< regress.in') +REGRESSION_TEST(`c3', `sed ''`3,/no such string/c\ +foo +''`< regress.in') REGRESSION_END() diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 61bc3727f58ae..865529e82ed59 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -128,7 +128,7 @@ redirect: case 'c': pd = 1; psl = 0; - if (cp->a2 == NULL || lastaddr) + if (cp->a2 == NULL || lastaddr || lastline()) (void)fprintf(outfile, "%s", cp->t); break; case 'd': |
