summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2001-05-17 01:02:58 +0000
committerMatt Kraai2001-05-17 01:02:58 +0000
commit233817437ded7a4a7505bc2cdb01eb7c953472c2 (patch)
treeb49802a74fbc044f1f9d1158bda93fa3806e5b58
parentbfae2529b8aa7b12b19da2ec7ad00ba717941074 (diff)
downloadbusybox-233817437ded7a4a7505bc2cdb01eb7c953472c2.zip
busybox-233817437ded7a4a7505bc2cdb01eb7c953472c2.tar.gz
Always print a newline after a matching substitution.
-rw-r--r--editors/sed.c7
-rw-r--r--sed.c7
2 files changed, 2 insertions, 12 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 1c22770..16e8e18 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)
break;
}
- /* if there's anything left of the line, print it */
- if (*hackline)
- puts(hackline);
- /* otherwise, we need to print a newline */
- else
- printf("\n");
+ puts(hackline);
/* cleanup */
free(regmatch);
diff --git a/sed.c b/sed.c
index 1c22770..16e8e18 100644
--- a/sed.c
+++ b/sed.c
@@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line)
break;
}
- /* if there's anything left of the line, print it */
- if (*hackline)
- puts(hackline);
- /* otherwise, we need to print a newline */
- else
- printf("\n");
+ puts(hackline);
/* cleanup */
free(regmatch);