Do not output highlighted text when saving projects (#5004)

This commit is contained in:
Roi Martin 2016-05-25 16:03:41 +02:00 committed by radare
parent 4b8af71ef4
commit 45efee7855

View File

@ -274,6 +274,7 @@ R_API char *r_core_project_info(RCore *core, const char *prjfile) {
R_API bool r_core_project_save_rdb(RCore *core, const char *file, int opts) {
char *filename;
const char *ohl;
int fd, fdold, tmp;
if (file == NULL || *file == '\0')
@ -286,6 +287,8 @@ R_API bool r_core_project_save_rdb(RCore *core, const char *file, int opts) {
return false;
}
ohl = strdup (r_config_get (core->config, "scr.highlight"));
r_config_set (core->config, "scr.highlight", "");
fdold = r_cons_singleton ()->fdout;
r_cons_singleton ()->fdout = fd;
r_cons_singleton ()->is_interactive = false;
@ -349,9 +352,11 @@ R_API bool r_core_project_save_rdb(RCore *core, const char *file, int opts) {
r_cons_singleton ()->fdout = fdold;
r_cons_singleton ()->is_interactive = true;
r_config_set (core->config, "scr.highlight", ohl);
close (fd);
free (filename);
free (ohl);
return true;
}