windows returns EINVAL for fopen when there is an asterisk in the name

closes #508
master
Andrew Kelley 2019-02-26 23:02:57 -05:00
parent 22dd0db9bf
commit c59ce046a0
3 changed files with 3 additions and 1 deletions

View File

@ -42,6 +42,7 @@ const char *err_str(Error err) {
case ErrorUnknownArchitecture: return "unrecognized architecture";
case ErrorUnknownOperatingSystem: return "unrecognized operating system";
case ErrorUnknownABI: return "unrecognized C ABI";
case ErrorInvalidFilename: return "invalid filename";
}
return "(invalid error)";
}

View File

@ -44,6 +44,7 @@ enum Error {
ErrorUnknownArchitecture,
ErrorUnknownOperatingSystem,
ErrorUnknownABI,
ErrorInvalidFilename,
};
const char *err_str(Error err);

View File

@ -1099,7 +1099,7 @@ Error os_fetch_file_path(Buf *full_path, Buf *out_contents, bool skip_shebang) {
case EINTR:
return ErrorInterrupted;
case EINVAL:
zig_unreachable();
return ErrorInvalidFilename;
case ENFILE:
case ENOMEM:
return ErrorSystemResources;