diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-08 00:20:36 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-08 00:20:36 +0200 |
commit | e4d925b8899e38437311d2c63d0d0d200e04b5a1 (patch) | |
tree | aff7162f35d57c8ec5eae70d249caef347f3db5d | |
parent | d7d4750e1e213e7448147186dddfe3bfbb47eea0 (diff) | |
download | busybox-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.c | 4 |
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)) { |