diff options
| author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-17 01:02:58 +0000 |
|---|---|---|
| committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-17 01:02:58 +0000 |
| commit | 1aa0bb1bdef46ab30d8a4ac295ab3d98c4e86f4b (patch) | |
| tree | b49802a74fbc044f1f9d1158bda93fa3806e5b58 | |
| parent | 7fd8ca978b0b626c92264f0694015a7d21d90e28 (diff) | |
| download | busybox-w32-1aa0bb1bdef46ab30d8a4ac295ab3d98c4e86f4b.tar.gz busybox-w32-1aa0bb1bdef46ab30d8a4ac295ab3d98c4e86f4b.tar.bz2 busybox-w32-1aa0bb1bdef46ab30d8a4ac295ab3d98c4e86f4b.zip | |
Always print a newline after a matching substitution.
git-svn-id: svn://busybox.net/trunk/busybox@2664 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | editors/sed.c | 7 | ||||
| -rw-r--r-- | sed.c | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/editors/sed.c b/editors/sed.c index 1c227704e..16e8e1866 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
| @@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line) | |||
| 577 | break; | 577 | break; |
| 578 | } | 578 | } |
| 579 | 579 | ||
| 580 | /* if there's anything left of the line, print it */ | 580 | puts(hackline); |
| 581 | if (*hackline) | ||
| 582 | puts(hackline); | ||
| 583 | /* otherwise, we need to print a newline */ | ||
| 584 | else | ||
| 585 | printf("\n"); | ||
| 586 | 581 | ||
| 587 | /* cleanup */ | 582 | /* cleanup */ |
| 588 | free(regmatch); | 583 | free(regmatch); |
| @@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line) | |||
| 577 | break; | 577 | break; |
| 578 | } | 578 | } |
| 579 | 579 | ||
| 580 | /* if there's anything left of the line, print it */ | 580 | puts(hackline); |
| 581 | if (*hackline) | ||
| 582 | puts(hackline); | ||
| 583 | /* otherwise, we need to print a newline */ | ||
| 584 | else | ||
| 585 | printf("\n"); | ||
| 586 | 581 | ||
| 587 | /* cleanup */ | 582 | /* cleanup */ |
| 588 | free(regmatch); | 583 | free(regmatch); |
