aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-09-15 12:07:48 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-09-15 12:07:48 +0000
commit977451ef446fc27d7d6e40a9ba01fce5ee0e25b6 (patch)
tree6636a19bb0c4433f719ba54dd5de699bd024468f /editors
parent47e5ca1ecb2a86b29c8a52ee3ed276d8b27147cf (diff)
downloadbusybox-977451ef446fc27d7d6e40a9ba01fce5ee0e25b6.tar.gz
Fix a simple mistake with pattern space, and add a test for it
Diffstat (limited to 'editors')
-rw-r--r--editors/sed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 05eb744a4..da15c4d06 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1070,9 +1070,9 @@ static void process_file(FILE * file)
}
pattern_space = xrealloc(pattern_space, pattern_space_size + hold_space_size);
if (pattern_space_size == 2) {
- strcat(pattern_space, "\n");
- } else {
strcpy(pattern_space, "\n");
+ } else {
+ strcat(pattern_space, "\n");
}
if (hold_space) {
strcat(pattern_space, hold_space);