Fix to always save history when exiting

When exiting radare by using ctrl+d or due to null stdin read it doesnt save
history as expected. Actually it was only saving when exiting using 'q'.
This commit is contained in:
NighterMan 2015-01-16 17:29:12 +01:00 committed by pancake
parent 9503e8506a
commit 53a554f358
2 changed files with 1 additions and 2 deletions

View File

@ -767,6 +767,7 @@ int main(int argc, char **argv, char **envp) {
prj = r_config_get (r.config, "file.project");
if (prj && *prj && r_cons_yesno ('y', "Do you want to save the project? (Y/n)"))
r_core_project_save (&r, prj);
r_line_hist_save (R2_HOMEDIR"/history");
} else {
// r_core_project_save (&r, prj);
if (debug) {

View File

@ -19,12 +19,10 @@ static int cmd_quit(void *data, const char *input) {
return -2;
case '\0':
core->num->value = 0LL;
r_line_hist_save (R2_HOMEDIR"/history");
return -2;
default:
if (*input == ' ')
input++;
r_line_hist_save (R2_HOMEDIR"/history");
if (*input)
r_num_math (core->num, input);
else core->num->value = 0LL;