diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-03-26 19:01:25 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-03-26 19:01:25 +0100 |
commit | b9e65ec63d3020251d34ed79a4fb8868d8b7e2be (patch) | |
tree | 99d406d0fd6ce3befc9fb93dee4679f2fdb19de6 /src/plugins/alias | |
parent | 24135801b49cda825146ea9e831f7927ff945dbe (diff) | |
download | weechat-b9e65ec63d3020251d34ed79a4fb8868d8b7e2be.zip |
Fix bug with writing of configuration files when disk is full (bug #29331)
Diffstat (limited to 'src/plugins/alias')
-rw-r--r-- | src/plugins/alias/alias-config.c | 97 |
1 files changed, 65 insertions, 32 deletions
diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c index 4657a7d1c..75719c5c7 100644 --- a/src/plugins/alias/alias-config.c +++ b/src/plugins/alias/alias-config.c @@ -144,7 +144,7 @@ alias_config_reload (void *data, struct t_config_file *config_file) * file in section "cmd" (command) */ -void +int alias_config_cmd_write_default_cb (void *data, struct t_config_file *config_file, const char *section_name) @@ -152,38 +152,71 @@ alias_config_cmd_write_default_cb (void *data, /* make C compiler happy */ (void) data; - weechat_config_write_line (config_file, section_name, NULL); + if (!weechat_config_write_line (config_file, section_name, NULL)) + return WEECHAT_CONFIG_WRITE_ERROR; + + if (!weechat_config_write_line (config_file, "AAWAY", "%s", "\"allserv /away\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "AME", "%s", "\"allchan /me\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "AMSG", "%s", "\"allchan /msg *\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "ANICK", "%s", "\"allserv /nick\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "BYE", "%s", "\"quit\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "C", "%s", "\"buffer clear\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "CL", "%s", "\"buffer clear\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "CLOSE", "%s", "\"buffer close\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "CHAT", "%s", "\"dcc chat\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "EXIT", "%s", "\"quit\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "IG", "%s", "\"ignore\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "J", "%s", "\"join\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "K", "%s", "\"kick\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "KB", "%s", "\"kickban\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "LEAVE", "%s", "\"part\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "M", "%s", "\"msg\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "MUB", "%s", "\"unban *\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "N", "%s", "\"names\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "Q", "%s", "\"query\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "REDRAW", "%s", "\"window refresh\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "SAY", "%s", "\"msg *\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "SIGNOFF", "%s", "\"quit\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "T", "%s", "\"topic\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "UB", "%s", "\"unban\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "V", "%s", "\"command core version\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "W", "%s", "\"who\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "WC", "%s", "\"window merge\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "WI", "%s", "\"whois\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "WII", "%s", "\"whois $1 $1\"")) + return WEECHAT_CONFIG_WRITE_ERROR; + if (!weechat_config_write_line (config_file, "WW", "%s", "\"whowas\"")) + return WEECHAT_CONFIG_WRITE_ERROR; - weechat_config_write_line (config_file, "AAWAY", "%s", "\"allserv /away\""); - weechat_config_write_line (config_file, "AME", "%s", "\"allchan /me\""); - weechat_config_write_line (config_file, "AMSG", "%s", "\"allchan /msg *\""); - weechat_config_write_line (config_file, "ANICK", "%s", "\"allserv /nick\""); - weechat_config_write_line (config_file, "BYE", "%s", "\"quit\""); - weechat_config_write_line (config_file, "C", "%s", "\"buffer clear\""); - weechat_config_write_line (config_file, "CL", "%s", "\"buffer clear\""); - weechat_config_write_line (config_file, "CLOSE", "%s", "\"buffer close\""); - weechat_config_write_line (config_file, "CHAT", "%s", "\"dcc chat\""); - weechat_config_write_line (config_file, "EXIT", "%s", "\"quit\""); - weechat_config_write_line (config_file, "IG", "%s", "\"ignore\""); - weechat_config_write_line (config_file, "J", "%s", "\"join\""); - weechat_config_write_line (config_file, "K", "%s", "\"kick\""); - weechat_config_write_line (config_file, "KB", "%s", "\"kickban\""); - weechat_config_write_line (config_file, "LEAVE", "%s", "\"part\""); - weechat_config_write_line (config_file, "M", "%s", "\"msg\""); - weechat_config_write_line (config_file, "MUB", "%s", "\"unban *\""); - weechat_config_write_line (config_file, "N", "%s", "\"names\""); - weechat_config_write_line (config_file, "Q", "%s", "\"query\""); - weechat_config_write_line (config_file, "REDRAW", "%s", "\"window refresh\""); - weechat_config_write_line (config_file, "SAY", "%s", "\"msg *\""); - weechat_config_write_line (config_file, "SIGNOFF", "%s", "\"quit\""); - weechat_config_write_line (config_file, "T", "%s", "\"topic\""); - weechat_config_write_line (config_file, "UB", "%s", "\"unban\""); - weechat_config_write_line (config_file, "V", "%s", "\"command core version\""); - weechat_config_write_line (config_file, "W", "%s", "\"who\""); - weechat_config_write_line (config_file, "WC", "%s", "\"window merge\""); - weechat_config_write_line (config_file, "WI", "%s", "\"whois\""); - weechat_config_write_line (config_file, "WII", "%s", "\"whois $1 $1\""); - weechat_config_write_line (config_file, "WW", "%s", "\"whowas\""); + return WEECHAT_CONFIG_WRITE_OK; } /* |