projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7d4750
)
sed: support "-f -" idiom
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 7 Apr 2016 22:20:36 +0000
(
00:20
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 7 Apr 2016 22:20:36 +0000
(
00:20
+0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/sed.c
patch
|
blob
|
history
diff --git
a/editors/sed.c
b/editors/sed.c
index 4c7f75521f768f8f8b01913aeb324b5cfd873880..9c4c8e1486f78a525b0162c1edf9c2de931318a5 100644
(file)
--- 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)) {