diff --git a/source/libublsettings-char.c b/source/libublsettings-char.c index 90b75a5..cdd26cb 100644 --- a/source/libublsettings-char.c +++ b/source/libublsettings-char.c @@ -243,7 +243,6 @@ char *yon_char_from_long(long int_to_convert) } char* yon_char_replace(char *source, char *find, char *replace){ - // int cur_pos = 0; int size; config_str parsed = yon_char_parse(source,&size,find); char *final = yon_char_parsed_to_string(parsed,size,replace); @@ -567,7 +566,8 @@ char *yon_char_parsed_to_string(config_str parsed, int size, char *divider_repla if (!yon_char_is_empty(final_string)){ return final_string; } else return NULL; - } else if (size==0&&!parsed) return ""; + } + return ""; } char *yon_char_parsed_to_string_for_iters(config_str parsed, int size, char *divider_replace,int iterations){ diff --git a/source/libublsettings-config.c b/source/libublsettings-config.c index ba6615c..c7bd934 100644 --- a/source/libublsettings-config.c +++ b/source/libublsettings-config.c @@ -707,7 +707,7 @@ enum YON_CONFIG_SAVED_TYPE yon_config_register(char *key,char *config_load, char current->data = yon_char_new(data); } } else { - yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,NULL); + yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,data); current = __yon__config__strings; } diff --git a/source/libublsettings-file.c b/source/libublsettings-file.c index 67ef66e..8aef530 100644 --- a/source/libublsettings-file.c +++ b/source/libublsettings-file.c @@ -41,7 +41,7 @@ int yon_file_save(char *file_path, char *text){ FILE *file = fopen(file_path,"w"); struct passwd *user = getpwnam(yon_ubl_root_user_get()); if (chown(file_path,user->pw_uid,user->pw_gid)){}; - if (chmod(file_path,0755)){}; + if (chmod(file_path,0644)){}; if (file){ fputs(text,file); fclose(file); @@ -58,7 +58,7 @@ int yon_file_create(char *path, char *name, int rules){ if (fl){ struct passwd *user = getpwnam(yon_ubl_root_user_get()); if (chown(path,user->pw_uid,user->pw_gid)){}; - if (chmod(path,0755)){}; + if (chmod(path,0644)){}; fclose(fl); return 1; } else { @@ -83,7 +83,7 @@ int yon_file_create_full_path(char *path, mode_t rules){ if (!yon_char_is_empty(temp)){ if (access(temp,F_OK)){ if (i!=size-1){ - mkdir(temp,0755); + mkdir(temp,0644); struct passwd *user = getpwnam(yon_ubl_root_user_get()); } else { FILE *fl = fopen(temp,"w"); @@ -94,7 +94,7 @@ int yon_file_create_full_path(char *path, mode_t rules){ if (i>2){ struct passwd *user = getpwnam(yon_ubl_root_user_get()); int chown_success = chown(temp,user->pw_uid,user->pw_gid); - int chmod_success = chmod(temp,0755); + int chmod_success = chmod(temp,0644); } } if (!yon_char_is_empty(current)) free(current);