summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-10-27 10:05:19 +0100
committerClifford Wolf <clifford@clifford.at>2013-10-27 10:05:19 +0100
commitf39c0c992839fb79f667d404a6edc85bcb662dcf (patch)
tree12133255facc074ca054f6c4255a7672666faeac
parent88cd2eadf5f889eb0187f25789a9e6bd95ccdb7b (diff)
Fixed get_share_file_name() for installed yosys
-rw-r--r--kernel/driver.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index d726639c..1e8b86a3 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -430,12 +430,13 @@ std::string get_share_file_name(std::string file)
log_error("Can't find file `%s': reading of /proc/self/exe failed!\n", file.c_str());
buffer[buflen] = 0;
+ const char *dir = dirname(buffer);
- std::string newfile_inplace = stringf("%s/share/%s", dirname(buffer), file.c_str());
+ std::string newfile_inplace = stringf("%s/share/%s", dir, file.c_str());
if (access(newfile_inplace.c_str(), F_OK) == 0)
return newfile_inplace;
- std::string newfile_system = stringf("%s/../share/yosys/%s", dirname(buffer), file.c_str());
+ std::string newfile_system = stringf("%s/../share/yosys/%s", dir, file.c_str());
if (access(newfile_system.c_str(), F_OK) == 0)
return newfile_system;