| 70 | |
| 71 | #ifdef HAVE_READLINE_READLINE_H |
| 72 | char* gjs_console_get_repl_history_path() { |
| 73 | const char* user_history_path = g_getenv("GJS_REPL_HISTORY"); |
| 74 | Gjs::AutoChar default_history_path = |
| 75 | g_build_filename(g_get_user_cache_dir(), "gjs_repl_history", nullptr); |
| 76 | bool is_write_history_disabled = |
| 77 | user_history_path && user_history_path[0] == '\0'; |
| 78 | if (is_write_history_disabled) |
| 79 | return nullptr; |
| 80 | |
| 81 | if (user_history_path) |
| 82 | return g_strdup(user_history_path); |
| 83 | return default_history_path.release(); |
| 84 | } |
| 85 | |
| 86 | void gjs_console_write_repl_history(const char* path) { |
| 87 | if (path) { |