mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-15 13:28:59 +00:00
Fix history namespace collision
This commit is contained in:
parent
c0ca99483c
commit
1f517d2b96
|
@ -120,19 +120,19 @@ const char *prompt()
|
||||||
#else /* EMSCRIPTEN */
|
#else /* EMSCRIPTEN */
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_READLINE
|
#ifdef YOSYS_ENABLE_READLINE
|
||||||
int history_offset = 0;
|
int yosys_history_offset = 0;
|
||||||
std::string history_file;
|
std::string yosys_history_file;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void yosys_atexit()
|
void yosys_atexit()
|
||||||
{
|
{
|
||||||
#ifdef YOSYS_ENABLE_READLINE
|
#ifdef YOSYS_ENABLE_READLINE
|
||||||
if (!history_file.empty()) {
|
if (!yosys_history_file.empty()) {
|
||||||
if (history_offset > 0) {
|
if (yosys_history_offset > 0) {
|
||||||
history_truncate_file(history_file.c_str(), 100);
|
history_truncate_file(yosys_history_file.c_str(), 100);
|
||||||
append_history(where_history() - history_offset, history_file.c_str());
|
append_history(where_history() - yosys_history_offset, yosys_history_file.c_str());
|
||||||
} else
|
} else
|
||||||
write_history(history_file.c_str());
|
write_history(yosys_history_file.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_history();
|
clear_history();
|
||||||
|
@ -161,9 +161,9 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_READLINE
|
#ifdef YOSYS_ENABLE_READLINE
|
||||||
if (getenv("HOME") != NULL) {
|
if (getenv("HOME") != NULL) {
|
||||||
history_file = stringf("%s/.yosys_history", getenv("HOME"));
|
yosys_history_file = stringf("%s/.yosys_history", getenv("HOME"));
|
||||||
read_history(history_file.c_str());
|
read_history(yosys_history_file.c_str());
|
||||||
history_offset = where_history();
|
yosys_history_offset = where_history();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue