From c6e5e3ed58fe1cf534c4ba47c46b46e6bc460182 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 20 Sep 2023 17:28:41 +0600 Subject: [PATCH] replaced function calls --- source/ubl-settings-repomanager.c | 12 ++++++------ source/ubl-utils.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/ubl-settings-repomanager.c b/source/ubl-settings-repomanager.c index 0992a84..df2d52b 100644 --- a/source/ubl-settings-repomanager.c +++ b/source/ubl-settings-repomanager.c @@ -193,7 +193,7 @@ void on_save(){ repo_sign_flagged=yon_char_divide_search(repo_sign_flagged,">",-1); if (repostatus == 1) gtk_tree_store_set(main_config.tree_store,&iter,0,folder_no_edits,3,0,-1); else if (repostatus == -1){ - system(yon_char_unite("rm -rfd ",origin_flagged,NULL)); + yon_launch(yon_char_unite("rm -rfd ",origin_flagged,NULL)); yon_window_config_erase_custom_parameter(origin_flagged,"repos"); GtkTreeIter *deleteIter = gtk_tree_iter_copy(&iter); if (!gtk_tree_model_iter_previous(GTK_TREE_MODEL(main_config.tree_store),deleteIter)){ @@ -287,11 +287,11 @@ void on_save(){ } if (!add_packages&&!signed_packages&&!remove_packages&&repostatus==1) add_command = yon_char_unite(command, " add -d \"",origin_flagged,"\" -r \"",name_flagged,sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" ,NULL); - if (add_signed_command){ system(add_signed_command); + if (add_signed_command){ yon_launch(add_signed_command); yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);} - if (add_command) { system(add_command); + if (add_command) { yon_launch(add_command); yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);} - if (remove_command) { system(remove_command); + if (remove_command) { yon_launch(remove_command); yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);} if (pack_groups){ dictionary *dct; @@ -302,14 +302,14 @@ void on_save(){ signed_packs=yon_char_unite(signed_packs ? yon_char_append(signed_packs,","): "" ,pck->key,NULL); } char *sign_command = yon_char_unite(command, " add -f -d ",origin_flagged," -r ",name_flagged," --sign-pkg ", dct->key," -p $(find ",origin_flagged,"/pool/overlay -name ", signed_packs,")",NULL); - system(sign_command); + yon_launch(sign_command); } } if (repo_sign_flagged){ char *repo_sign_command = yon_char_unite(command, " add -f -d ",origin_flagged, " -r ", name_flagged, " --sign-repo ", repo_sign_flagged ,NULL); yon_window_config_add_custom_parameter(yon_char_unite(origin_flagged,NULL),"signatures",repo_sign_flagged_full,YON_TYPE_STRING); - system(repo_sign_command); + yon_launch(repo_sign_command); } } } diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 2403ef2..b75f4ff 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -818,7 +818,7 @@ char *yon_ubl_root_user_get(){ char *yon_ubl_user_get_home_directory(){ FILE *path = popen(get_home_dir_command,"r"); char *ret = g_malloc(4096); - fgets(ret,4096,path); + if (fgets(ret,4096,path)); ret=yon_char_divide_search(ret,"\n",-1); return ret; } -- 2.35.1