From 82ba2eefcbab0d6e90a0eb5ced8539caaa8e3fd8 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 4 Aug 2023 16:29:01 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=B2=D0=B2?= =?UTF-8?q?=D0=BE=D0=B4=D0=B0=20=D0=BF=D1=83=D1=82=D0=B5=D0=B9=20=D1=81=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/model/model.c | 14 +++++++++++--- source/model/save.c | 15 +++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/source/model/model.c b/source/model/model.c index 0838803..a2c5335 100644 --- a/source/model/model.c +++ b/source/model/model.c @@ -334,6 +334,13 @@ char* format_str_del_config(config_u_g_p* _config) { char* space = g_malloc0(sizeof(char)*2); char* actors = yon_char_new(""); char* cmd = NULL; + char* unix_file = NULL; + if (strstr(_config->UNIX_file, " ")) { + unix_file = yon_char_unite("\"", _config->UNIX_file, "\"", NULL); + } + else { + unix_file = yon_char_new(_config->UNIX_file); + } for (int i = 0; i < _config->actors.vectorList.total; i++) { actors = yon_char_unite(actors, space, _config->actors.pfVectorGet(&_config->actors, i), NULL); space[0] = ','; @@ -341,17 +348,18 @@ char* format_str_del_config(config_u_g_p* _config) { } if (strstr(_config->type_arr, "prjquota")) { if (_config->actors.vectorList.total == 0) { - cmd = yon_char_unite(_config->type_arr, ":", _config->UNIX_file, ":",fill_tree_view_id(_config->id), NULL); + cmd = yon_char_unite(_config->type_arr, ":", unix_file, ":",fill_tree_view_id(_config->id), NULL); } else { - cmd = yon_char_unite(_config->type_arr, ":", _config->UNIX_file, ":",fill_tree_view_id(_config->id), ",", actors, NULL); + cmd = yon_char_unite(_config->type_arr, ":", unix_file, ":",fill_tree_view_id(_config->id), ",", actors, NULL); } } else { - cmd = yon_char_unite(_config->type_arr, ":", _config->UNIX_file, ":", actors, NULL); + cmd = yon_char_unite(_config->type_arr, ":", unix_file, ":", actors, NULL); } free(space); + free(unix_file); return cmd; } diff --git a/source/model/save.c b/source/model/save.c index b60273a..66ebf18 100644 --- a/source/model/save.c +++ b/source/model/save.c @@ -202,20 +202,27 @@ char* save_format_key(config_u_g_p* config, int index) { char* key = yon_char_new(""); int number = config->id; key = yon_char_unite("DISK_QUOTA[", config->type_arr, ":", NULL); + char* unix_file = NULL; + if (strstr(config->UNIX_file, " ")) { + unix_file = yon_char_unite("\"", config->UNIX_file, "\"", NULL); + } + else { + unix_file = yon_char_new(config->UNIX_file); + } if (strstr(config->type_arr, "prjquota")) { if (number!=-1) { - key = yon_char_unite(key, config->UNIX_file,":",yon_char_from_int(number), NULL); + key = yon_char_unite(key, unix_file,":",yon_char_from_int(number), NULL); } else { - key = yon_char_unite(key, config->UNIX_file,":AUTO", NULL); + key = yon_char_unite(key, unix_file,":AUTO", NULL); } key = yon_char_unite(key, save_str_users(config, index, ",") , "]", NULL); } else { - key = yon_char_unite(key, config->UNIX_file, NULL); + key = yon_char_unite(key, unix_file, NULL); key = yon_char_unite(key, save_str_users(config, index, ":") , "]", NULL); } - + free(unix_file); return key; }