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; }