Never close stdin; allow multiple - arguments
This commit is contained in:
1 parent
b70bea8d34
commit
7a8e3c759e
1 file changed
+5
-1
@@ -151,7 +151,11 @@ int next_input_idx;
|
|||||||
static int read_more(char* buf, size_t size, int* islast) {
|
static int read_more(char* buf, size_t size, int* islast) {
|
||||||
while (!current_input || feof(current_input)) {
|
while (!current_input || feof(current_input)) {
|
||||||
if (current_input) {
|
if (current_input) {
|
||||||
fclose(current_input);
|
if (current_input == stdin) {
|
||||||
|
clearerr(stdin); // perhaps we can read again
|
||||||
|
} else {
|
||||||
|
fclose(current_input);
|
||||||
|
}
|
||||||
current_input = 0;
|
current_input = 0;
|
||||||
}
|
}
|
||||||
if (next_input_idx == ninput_files) {
|
if (next_input_idx == ninput_files) {
|
||||||
|
|||||||
Reference in new issue
Block a user