From 718c53320dc6b811aeda5579da79ebc9c6467ccf Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Nov 2023 09:44:00 +0600 Subject: [PATCH] Fixed Saving --- source/ubl-settings-logging.c | 2 ++ source/ubl-utils.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index 8c4eaae..a3b682c 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -1439,6 +1439,7 @@ void on_journald_save(GtkWidget *self, journald_window *window){ TTY = (char*)gtk_entry_get_text(GTK_ENTRY(window->RedirectTTYEntry)); if (yon_char_is_empty(TTY)) consoleforwardactive=0; + else } else if (consoleforwardactive == 2){ confor = "no"; @@ -1460,6 +1461,7 @@ void on_journald_save(GtkWidget *self, journald_window *window){ yon_config_remove_by_key(JOURNALD("SplitMode")); if (consoleforwardactive != 0) yon_config_register(JOURNALD("ForwardToConsole"),"logging",confor); + yon_config_register(JOURNALD("TTYPath"),"logging",TTY); else yon_config_remove_by_key(JOURNALD("ForwardToConsole")); if (forwardempty!=0) diff --git a/source/ubl-utils.c b/source/ubl-utils.c index c7b87c4..b405491 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -1350,7 +1350,7 @@ int yon_config_save_registered(char *path){ if (dct->data&&strcmp(yon_dictionary_get_data(dct,char*),"")!=0){ if (((yon_config_parameter*)dct)->flag1==1){ ((yon_config_parameter*)dct)->flag1=0; - if (sections_add&&yon_dictionary_get(§ions_add,((yon_config_parameter*)dct)->section)) sections_add->data=(void*)yon_char_unite(yon_dictionary_get_data(sections_add,char*)," ",dct->key,"=",yon_dictionary_get_data(dct,char*),NULL); + if (sections_add&&yon_dictionary_get(§ions_add,((yon_config_parameter*)dct)->section)) sections_add->data=(void*)yon_char_unite(yon_dictionary_get_data(sections_add,char*)," ",dct->key,"=\"",yon_dictionary_get_data(dct,char*),"\"",NULL); else yon_dictionary_add_or_create_if_exists_with_data(sections_add,((yon_config_parameter*)dct)->section,yon_char_unite (ubconfig_save_command,path ? yon_char_append(" --target ",path):"", " set ", ((yon_config_parameter*)dct)->section, " ",dct->key,"=\"",yon_dictionary_get_data(dct,char*),"\"",NULL)); } else if (((yon_config_parameter*)dct)->flag1==-1){ ((yon_config_parameter*)dct)->flag1=0;