summaryrefslogtreecommitdiff
path: root/src/plugins/logger
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-02-21 13:36:39 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-02-21 13:36:39 +0100
commit2dbcffc93e3e9809dda407c65f665a3b93e22750 (patch)
treefc7f8acd1fd1fc58d8385c9fb5a148548b7ea68a /src/plugins/logger
parentf535aad9fc1abbce94d3cc665028973bae4f32d3 (diff)
downloadweechat-2dbcffc93e3e9809dda407c65f665a3b93e22750.zip
logger: return WEECHAT_RC_ERROR in command /logger if arguments are wrong/missing
Diffstat (limited to 'src/plugins/logger')
-rw-r--r--src/plugins/logger/logger.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index da668fea4..9188cfdf3 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -887,28 +887,26 @@ logger_command_cb (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_OK;
}
- if (argc > 1)
+ if (weechat_strcasecmp (argv[1], "set") == 0)
{
- if (weechat_strcasecmp (argv[1], "set") == 0)
- {
- if (argc > 2)
- logger_set_buffer (buffer, argv[2]);
- return WEECHAT_RC_OK;
- }
+ if (argc > 2)
+ logger_set_buffer (buffer, argv[2]);
+ return WEECHAT_RC_OK;
+ }
- if (weechat_strcasecmp (argv[1], "flush") == 0)
- {
- logger_flush ();
- return WEECHAT_RC_OK;
- }
+ if (weechat_strcasecmp (argv[1], "flush") == 0)
+ {
+ logger_flush ();
+ return WEECHAT_RC_OK;
+ }
- if (weechat_strcasecmp (argv[1], "disable") == 0)
- {
- logger_set_buffer (buffer, "0");
- }
+ if (weechat_strcasecmp (argv[1], "disable") == 0)
+ {
+ logger_set_buffer (buffer, "0");
+ return WEECHAT_RC_OK;
}
- return WEECHAT_RC_OK;
+ return WEECHAT_RC_ERROR;
}
/*