aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-04-08 00:20:36 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-04-08 00:20:36 +0200
commite4d925b8899e38437311d2c63d0d0d200e04b5a1 (patch)
treeaff7162f35d57c8ec5eae70d249caef347f3db5d /editors
parentd7d4750e1e213e7448147186dddfe3bfbb47eea0 (diff)
downloadbusybox-e4d925b8899e38437311d2c63d0d0d200e04b5a1.tar.gz
sed: support "-f -" idiom
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
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 4c7f75521..9c4c8e148 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1507,12 +1507,12 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
while (opt_f) { // -f
char *line;
FILE *cmdfile;
- cmdfile = xfopen_for_read(llist_pop(&opt_f));
+ cmdfile = xfopen_stdin(llist_pop(&opt_f));
while ((line = xmalloc_fgetline(cmdfile)) != NULL) {
add_cmd(line);
free(line);
}
- fclose(cmdfile);
+ fclose_if_not_stdin(cmdfile);
}
/* if we didn't get a pattern from -e or -f, use argv[0] */
if (!(opt & 0x30)) {