Support for old ublinux commands format

pull/57/head
parent 6de6c52c33
commit c7f9d133bd
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -429,17 +429,19 @@ int yon_config_load_config(YON_CONFIG_TYPE config_type, ...){
}
char *final_command = yon_config_command_get_full(commands,commands_size);
if (yon_char_is_empty(final_command)) return 0;
int parameters_size;
printf("%s\n",final_command);
config_str parameters = yon_config_load(final_command,&parameters_size);
char *section = NULL;
if (!strstr(final_command," -ea ")){
section = yon_config_command_get_section(final_command);
}
for (int i=0;i<parameters_size;i++){
if (!strcmp(parameters[i],"(null)\n")) continue;
yon_char_remove_last_symbol(parameters[i],'\n');
char *value = yon_char_new(parameters[i]);
char *parameter = yon_char_divide_search(value,"=",-1);
char *section = NULL;
if (final_command[0]=='['){
if (parameter[0]=='['){
section = yon_char_divide_search(parameter," ",-1);
free(yon_char_divide(section,yon_char_find_last(section,'/')));
yon_char_remove_last_symbol(section,']');

Loading…
Cancel
Save