aboutsummaryrefslogtreecommitdiff
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
parentd7d4750e1e213e7448147186dddfe3bfbb47eea0 (diff)
downloadbusybox-w32-e4d925b8899e38437311d2c63d0d0d200e04b5a1.tar.gz
busybox-w32-e4d925b8899e38437311d2c63d0d0d200e04b5a1.tar.bz2
busybox-w32-e4d925b8899e38437311d2c63d0d0d200e04b5a1.zip
sed: support "-f -" idiom
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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)
1507 while (opt_f) { // -f 1507 while (opt_f) { // -f
1508 char *line; 1508 char *line;
1509 FILE *cmdfile; 1509 FILE *cmdfile;
1510 cmdfile = xfopen_for_read(llist_pop(&opt_f)); 1510 cmdfile = xfopen_stdin(llist_pop(&opt_f));
1511 while ((line = xmalloc_fgetline(cmdfile)) != NULL) { 1511 while ((line = xmalloc_fgetline(cmdfile)) != NULL) {
1512 add_cmd(line); 1512 add_cmd(line);
1513 free(line); 1513 free(line);
1514 } 1514 }
1515 fclose(cmdfile); 1515 fclose_if_not_stdin(cmdfile);
1516 } 1516 }
1517 /* if we didn't get a pattern from -e or -f, use argv[0] */ 1517 /* if we didn't get a pattern from -e or -f, use argv[0] */
1518 if (!(opt & 0x30)) { 1518 if (!(opt & 0x30)) {