1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

Fix bug in config_file_write_line with empty value, when called from script plugins

This commit is contained in:
Sebastien Helleu
2009-02-19 12:30:30 +01:00
parent c76fa7e733
commit 0ca39f974b
+11 -8
View File
@@ -1709,19 +1709,22 @@ config_file_write_line (struct t_config_file *config_file,
if (!config_file || !option_name)
return;
if (value)
if (value && value[0])
{
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);
if (buf[0])
{
string_iconv_fprintf (config_file->file, "%s = %s\n",
option_name, buf);
return;
}
}
string_iconv_fprintf (config_file->file, "\n[%s]\n",
option_name);
}
/*