main: Make -s - read from stdin

This commit is contained in:
ZyX 2017-03-16 23:24:20 +03:00
parent 0cab62ad6f
commit 65c41e6c2b

View File

@ -1056,7 +1056,9 @@ scripterror:
mch_errmsg("\"\n");
mch_exit(2);
}
if ((scriptin[0] = mch_fopen(argv[0], READBIN)) == NULL) {
if (STRCMP(argv[0], "-") == 0) {
scriptin[0] = stdin;
} else if ((scriptin[0] = mch_fopen(argv[0], READBIN)) == NULL) {
mch_errmsg(_("Cannot open for reading: \""));
mch_errmsg(argv[0]);
mch_errmsg("\"\n");