aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)) {