[ion/simulator] Allow "-" to designate stdin

This commit is contained in:
Romain Goyet
2020-09-11 16:39:35 -04:00
committed by Léa Saviot
parent 2cf6f15dde
commit a4213dcca8

View File

@@ -48,7 +48,12 @@ static inline bool load(FILE * f) {
}
void load(const char * filename) {
FILE * f = fopen(filename, "rb");
FILE * f = nullptr;
if (strcmp(filename, "-") == 0) {
f = stdin;
} else {
f = fopen(filename, "rb");
}
if (f == nullptr) {
return;
}