diff options
-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)) { |