prefs.c: consistent indentation

This commit is contained in:
wdlkmpx 2021-01-14 22:52:00 +08:00
parent 08f868a3e0
commit 88feee2703

View File

@ -142,7 +142,8 @@ gchar *pref_bool_to_str(gboolean val) {
/* we use very lame preferences file format: ``property=value\n''.
so - there must be no whitespaces on begin/end of line =) */
void load_preferences(void) {
void load_preferences(void)
{
FILE *fp;
gchar *rc_file;
gchar buffer[BUFFER_SIZE];
@ -152,11 +153,14 @@ void load_preferences(void) {
_theme_name = g_strdup(_default_theme_name);
}
rc_file = find_rc_file();
if((fp = fopen(rc_file, "r"))) {
while(fgets(buffer, BUFFER_SIZE, fp)) {
if ((fp = fopen(rc_file, "r")))
{
while(fgets(buffer, BUFFER_SIZE, fp))
{
g_strchomp(buffer);
prop_val = g_strsplit(buffer, "=", 2);
if(prop_val[0] && prop_val[0][0] && prop_val[1] && prop_val[1][0]) {
if (prop_val[0] && prop_val[0][0] && prop_val[1] && prop_val[1][0])
{
if (!g_ascii_strcasecmp(prop_val[0], "show_hints")) {
_show_next_colors = pref_str_to_bool(prop_val[1]);
} else if (!g_ascii_strcasecmp(prop_val[0], "show_path")) {
@ -209,7 +213,8 @@ void write_pref_int(FILE *fp, gchar *property, gint value) {
fprintf (fp, "%s=%d\n", property, value);
}
gchar *save_preferences(void) {
gchar *save_preferences (void)
{
FILE *fp;
gchar *rc_file/*, *err*/;
gchar *ret = NULL;