1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

Fix bug with writing of configuration files when disk is full (bug #29331)

This commit is contained in:
Sebastien Helleu
2010-03-26 19:01:25 +01:00
parent 24135801b4
commit b9e65ec63d
28 changed files with 570 additions and 320 deletions
+24 -6
View File
@@ -1345,14 +1345,14 @@ weechat_lua_api_config_read_cb (void *data,
* weechat_lua_api_config_section_write_cb: callback for writing section
*/
void
int
weechat_lua_api_config_section_write_cb (void *data,
struct t_config_file *config_file,
const char *section_name)
{
struct t_script_callback *script_callback;
char *lua_argv[4], empty_arg[1] = { '\0' };
int *rc;
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -1368,11 +1368,20 @@ weechat_lua_api_config_section_write_cb (void *data,
script_callback->function,
lua_argv);
if (rc)
if (!rc)
ret = WEECHAT_CONFIG_WRITE_ERROR;
else
{
ret = *rc;
free (rc);
}
if (lua_argv[1])
free (lua_argv[1]);
return ret;
}
return WEECHAT_CONFIG_WRITE_ERROR;
}
/*
@@ -1380,14 +1389,14 @@ weechat_lua_api_config_section_write_cb (void *data,
* default values for section
*/
void
int
weechat_lua_api_config_section_write_default_cb (void *data,
struct t_config_file *config_file,
const char *section_name)
{
struct t_script_callback *script_callback;
char *lua_argv[4], empty_arg[1] = { '\0' };
int *rc;
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -1403,11 +1412,20 @@ weechat_lua_api_config_section_write_default_cb (void *data,
script_callback->function,
lua_argv);
if (rc)
if (!rc)
ret = WEECHAT_CONFIG_WRITE_ERROR;
else
{
ret = *rc;
free (rc);
}
if (lua_argv[1])
free (lua_argv[1]);
return ret;
}
return WEECHAT_CONFIG_WRITE_ERROR;
}
/*