MCPcopy Create free account
hub / github.com/GNOME/gjs / gjs_console_get_repl_history_path

Function gjs_console_get_repl_history_path

util/console.cpp:72–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71#ifdef HAVE_READLINE_READLINE_H
72char* 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
86void gjs_console_write_repl_history(const char* path) {
87 if (path) {

Callers 1

mainFunction · 0.85

Calls 1

releaseMethod · 0.45

Tested by

no test coverage detected