3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-05-14 19:24:45 +00:00

io: don't accept a directory when file expected

This commit is contained in:
Emil J. Tywoniak 2025-05-09 22:30:43 +02:00
parent 55bd950af4
commit b05c0c70af
4 changed files with 34 additions and 25 deletions

View file

@ -556,29 +556,29 @@ void init_share_dirname()
std::string proc_self_path = proc_self_dirname();
# if defined(_WIN32) && !defined(YOSYS_WIN32_UNIX_DIR)
std::string proc_share_path = proc_self_path + "share\\";
if (check_file_exists(proc_share_path, true)) {
if (check_directory_exists(proc_share_path, true)) {
yosys_share_dirname = proc_share_path;
return;
}
proc_share_path = proc_self_path + "..\\share\\";
if (check_file_exists(proc_share_path, true)) {
if (check_directory_exists(proc_share_path, true)) {
yosys_share_dirname = proc_share_path;
return;
}
# else
std::string proc_share_path = proc_self_path + "share/";
if (check_file_exists(proc_share_path, true)) {
if (check_directory_exists(proc_share_path, true)) {
yosys_share_dirname = proc_share_path;
return;
}
proc_share_path = proc_self_path + "../share/" + proc_program_prefix()+ "yosys/";
if (check_file_exists(proc_share_path, true)) {
if (check_directory_exists(proc_share_path, true)) {
yosys_share_dirname = proc_share_path;
return;
}
# ifdef YOSYS_DATDIR
proc_share_path = YOSYS_DATDIR "/";
if (check_file_exists(proc_share_path, true)) {
if (check_directory_exists(proc_share_path, true)) {
yosys_share_dirname = proc_share_path;
return;
}