summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config-file.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c
index 82f94c04c..fd352ee69 100644
--- a/src/core/wee-config-file.c
+++ b/src/core/wee-config-file.c
@@ -810,18 +810,19 @@ config_file_write_line (struct t_config_file *config_file,
if (!config_file || !option_name)
return;
- va_start (argptr, value);
- vsnprintf (buf, sizeof (buf) - 1, value, argptr);
- va_end (argptr);
-
- if (!buf[0])
- string_iconv_fprintf (config_file->file, "\n[%s]\n",
- option_name);
- else
+ if (value)
{
+ va_start (argptr, value);
+ vsnprintf (buf, sizeof (buf) - 1, value, argptr);
+ va_end (argptr);
string_iconv_fprintf (config_file->file, "%s = %s\n",
option_name, buf);
}
+ else
+ {
+ string_iconv_fprintf (config_file->file, "\n[%s]\n",
+ option_name);
+ }
}
/*