aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/sed.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/sed.c')
-rw-r--r--toys/posix/sed.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/posix/sed.c b/toys/posix/sed.c
index 063c20c3..71988248 100644
--- a/toys/posix/sed.c
+++ b/toys/posix/sed.c
@@ -1026,8 +1026,7 @@ void sed_main(void)
// so handle all -e, then all -f. (At least the behavior's consistent.)
for (al = TT.e; al; al = al->next) parse_pattern(&al->arg, strlen(al->arg));
- for (al = TT.f; al; al = al->next)
- do_lines(strcmp(al->arg, "-") ? xopen(al->arg, O_RDONLY) : 0,parse_pattern);
+ for (al = TT.f; al; al = al->next) do_lines(xopenro(al->arg), parse_pattern);
parse_pattern(0, 0);
dlist_terminate(TT.pattern);
if (TT.nextlen) error_exit("no }");