summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath2003-04-09 15:26:14 +0000
committerGlenn L McGrath2003-04-09 15:26:14 +0000
commitd87a7ac26947fefa8530559e9eb7f6f49e1b777a (patch)
treea31ed3a97cbaa6f69ae9093acb79d3f4862fc036
parent2410386611e104ee4e078b2182e3b9b2f9f3adff (diff)
downloadbusybox-d87a7ac26947fefa8530559e9eb7f6f49e1b777a.zip
busybox-d87a7ac26947fefa8530559e9eb7f6f49e1b777a.tar.gz
Fix the sed 'r' command
-rw-r--r--editors/sed.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 912318c..5ac7889 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -443,7 +443,6 @@ static int parse_file_cmd(sed_cmd_t * sed_cmd, const char *filecmdstr)
filenamelen = strcspn(&filecmdstr[idx], semicolon_whitespace);
sed_cmd->filename = xmalloc(filenamelen + 1);
safe_strncpy(sed_cmd->filename, &filecmdstr[idx], filenamelen + 1);
-
return idx + filenamelen;
}
@@ -996,10 +995,10 @@ static void process_file(FILE * file)
case 'r':{
FILE *outfile;
- puts(pattern_space);
outfile = fopen(sed_cmd->filename, "r");
- if (outfile)
+ if (outfile) {
bb_xprint_and_close_file(outfile);
+ }
/* else if we couldn't open the output file,
* no biggie, just don't print anything */
altered++;