Never close stdin; allow multiple - arguments

This commit is contained in:
Nicolas Williams committed 2014-08-30 00:40:03 -05:00
1 parent b70bea8d34
commit 7a8e3c759e
1 file changed
+5 -1
+5 -1
View File
@@ -151,7 +151,11 @@ int next_input_idx;
static int read_more(char* buf, size_t size, int* islast) {
while (!current_input || feof(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;
}
if (next_input_idx == ninput_files) {