files: prevent an infinite loop when reading from standard input fails

master
Benno Schulenberg 2018-03-20 11:25:16 +01:00
parent a1132c81a1
commit 3e5b0ea5fd
1 changed files with 1 additions and 1 deletions

View File

@ -2605,9 +2605,9 @@ int main(int argc, char **argv)
/* If the filename is a dash, read from standard input; otherwise,
* open the file; skip positioning the cursor if either failed. */
if (strcmp(argv[optind], "-") == 0) {
optind++;
if (!scoop_stdin())
continue;
optind++;
} else if (!open_buffer(argv[optind++], FALSE))
continue;