mirror of
https://github.com/YosysHQ/yosys
synced 2025-05-12 02:04:44 +00:00
gzip: reject uncompressing directories
This commit is contained in:
parent
b05c0c70af
commit
2e9a194ce9
1 changed files with 2 additions and 0 deletions
|
@ -102,6 +102,8 @@ gzip_istream::ibuf::~ibuf() {
|
|||
// returns the original ifstream, rewound to the start.
|
||||
// Never returns nullptr or failed state istream*
|
||||
std::istream* uncompressed(const std::string filename, std::ios_base::openmode mode) {
|
||||
if (!check_file_exists(filename))
|
||||
log_cmd_error("File `%s' not found or is a directory\n", filename.c_str());
|
||||
std::ifstream* f = new std::ifstream();
|
||||
f->open(filename, mode);
|
||||
if (f->fail())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue