Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow the XDG Base Directory Specification #4093

Merged
merged 12 commits into from
Feb 8, 2024
6 changes: 5 additions & 1 deletion kernel/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ int main(int argc, char **argv)
bool mode_q = false;

#if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
if (getenv("HOME") != NULL) {
if (getenv("XDG_DATA_HOME") != NULL && getenv("XDG_DATA_HOME")[0] != '\0') {
yosys_history_file = stringf("%s/yosys/.yosys_history", getenv("XDG_DATA_HOME"));
read_history(yosys_history_file.c_str());
yosys_history_offset = where_history();
} else if (getenv("HOME") != NULL) {
yosys_history_file = stringf("%s/.yosys_history", getenv("HOME"));
read_history(yosys_history_file.c_str());
yosys_history_offset = where_history();
Expand Down
Loading