summaryrefslogtreecommitdiff
path: root/src/plugins/trigger
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/trigger')
-rw-r--r--src/plugins/trigger/CMakeLists.txt2
-rw-r--r--src/plugins/trigger/Makefile.am2
-rw-r--r--src/plugins/trigger/trigger-buffer.c2
-rw-r--r--src/plugins/trigger/trigger-buffer.h8
-rw-r--r--src/plugins/trigger/trigger-callback.c10
-rw-r--r--src/plugins/trigger/trigger-callback.h8
-rw-r--r--src/plugins/trigger/trigger-command.c4
-rw-r--r--src/plugins/trigger/trigger-command.h8
-rw-r--r--src/plugins/trigger/trigger-completion.c2
-rw-r--r--src/plugins/trigger/trigger-completion.h8
-rw-r--r--src/plugins/trigger/trigger-config.c5
-rw-r--r--src/plugins/trigger/trigger-config.h8
-rw-r--r--src/plugins/trigger/trigger.c4
-rw-r--r--src/plugins/trigger/trigger.h8
14 files changed, 43 insertions, 36 deletions
diff --git a/src/plugins/trigger/CMakeLists.txt b/src/plugins/trigger/CMakeLists.txt
index b9d766c9e..b67f95881 100644
--- a/src/plugins/trigger/CMakeLists.txt
+++ b/src/plugins/trigger/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+# Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
diff --git a/src/plugins/trigger/Makefile.am b/src/plugins/trigger/Makefile.am
index cff2640ef..cf629b1f2 100644
--- a/src/plugins/trigger/Makefile.am
+++ b/src/plugins/trigger/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+# Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
diff --git a/src/plugins/trigger/trigger-buffer.c b/src/plugins/trigger/trigger-buffer.c
index d901cea00..43867ff64 100644
--- a/src/plugins/trigger/trigger-buffer.c
+++ b/src/plugins/trigger/trigger-buffer.c
@@ -1,7 +1,7 @@
/*
* trigger-buffer.c - debug buffer for triggers
*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
diff --git a/src/plugins/trigger/trigger-buffer.h b/src/plugins/trigger/trigger-buffer.h
index 0b96797d7..9ab5fc871 100644
--- a/src/plugins/trigger/trigger-buffer.h
+++ b/src/plugins/trigger/trigger-buffer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -17,8 +17,8 @@
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef WEECHAT_TRIGGER_BUFFER_H
-#define WEECHAT_TRIGGER_BUFFER_H 1
+#ifndef WEECHAT_PLUGIN_TRIGGER_BUFFER_H
+#define WEECHAT_PLUGIN_TRIGGER_BUFFER_H
#define TRIGGER_BUFFER_NAME "monitor"
@@ -32,4 +32,4 @@ extern int trigger_buffer_display_trigger (struct t_trigger *trigger,
struct t_hashtable *extra_vars);
extern void trigger_buffer_end ();
-#endif /* WEECHAT_TRIGGER_BUFFER_H */
+#endif /* WEECHAT_PLUGIN_TRIGGER_BUFFER_H */
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c
index 79b2955a9..2ed0909b4 100644
--- a/src/plugins/trigger/trigger-callback.c
+++ b/src/plugins/trigger/trigger-callback.c
@@ -1,7 +1,7 @@
/*
* trigger-callback.c - callbacks for triggers
*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -798,7 +798,9 @@ trigger_callback_print_cb (const void *pointer, void *data,
date_tmp = localtime (&date);
if (date_tmp)
{
- strftime (str_temp, sizeof (str_temp), "%Y-%m-%d %H:%M:%S", date_tmp);
+ if (strftime (str_temp, sizeof (str_temp),
+ "%Y-%m-%d %H:%M:%S", date_tmp) == 0)
+ str_temp[0] = '\0';
weechat_hashtable_set (extra_vars, "tg_date", str_temp);
}
snprintf (str_temp, sizeof (str_temp), "%d", displayed);
@@ -940,7 +942,9 @@ trigger_callback_timer_cb (const void *pointer, void *data,
date_tmp = localtime (&date);
if (date_tmp)
{
- strftime (str_temp, sizeof (str_temp), "%Y-%m-%d %H:%M:%S", date_tmp);
+ if (strftime (str_temp, sizeof (str_temp),
+ "%Y-%m-%d %H:%M:%S", date_tmp) == 0)
+ str_temp[0] = '\0';
weechat_hashtable_set (extra_vars, "tg_date", str_temp);
}
diff --git a/src/plugins/trigger/trigger-callback.h b/src/plugins/trigger/trigger-callback.h
index 0af3c5ab6..8eeec3171 100644
--- a/src/plugins/trigger/trigger-callback.h
+++ b/src/plugins/trigger/trigger-callback.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -17,8 +17,8 @@
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef WEECHAT_TRIGGER_CALLBACK_H
-#define WEECHAT_TRIGGER_CALLBACK_H 1
+#ifndef WEECHAT_PLUGIN_TRIGGER_CALLBACK_H
+#define WEECHAT_PLUGIN_TRIGGER_CALLBACK_H
#include <time.h>
@@ -118,4 +118,4 @@ extern struct t_hashtable *trigger_callback_focus_cb (const void *pointer,
extern void trigger_callback_init ();
extern void trigger_callback_end ();
-#endif /* WEECHAT_TRIGGER_CALLBACK_H */
+#endif /* WEECHAT_PLUGIN_TRIGGER_CALLBACK_H */
diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c
index 2e49a5478..5de047bc1 100644
--- a/src/plugins/trigger/trigger-command.c
+++ b/src/plugins/trigger/trigger-command.c
@@ -1,7 +1,7 @@
/*
* trigger-command.c - trigger command
*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -1171,7 +1171,7 @@ trigger_command_init ()
" regex: one or more regular expressions to replace strings "
"in variables\n"
" command: command to execute (many commands can be separated by "
- "\";\"\n"
+ "\";\")\n"
"return_code: return code in callback (ok (default), ok_eat, error)\n"
"post_action: action to take after execution (none (default), "
"disable, delete)\n"
diff --git a/src/plugins/trigger/trigger-command.h b/src/plugins/trigger/trigger-command.h
index 4336c9730..43eeec6d9 100644
--- a/src/plugins/trigger/trigger-command.h
+++ b/src/plugins/trigger/trigger-command.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -17,9 +17,9 @@
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef WEECHAT_TRIGGER_COMMAND_H
-#define WEECHAT_TRIGGER_COMMAND_H 1
+#ifndef WEECHAT_PLUGIN_TRIGGER_COMMAND_H
+#define WEECHAT_PLUGIN_TRIGGER_COMMAND_H
extern void trigger_command_init ();
-#endif /* WEECHAT_TRIGGER_COMMAND_H */
+#endif /* WEECHAT_PLUGIN_TRIGGER_COMMAND_H */
diff --git a/src/plugins/trigger/trigger-completion.c b/src/plugins/trigger/trigger-completion.c
index 52977bc4b..90c950597 100644
--- a/src/plugins/trigger/trigger-completion.c
+++ b/src/plugins/trigger/trigger-completion.c
@@ -1,7 +1,7 @@
/*
* trigger-completion.c - completion for trigger commands
*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
diff --git a/src/plugins/trigger/trigger-completion.h b/src/plugins/trigger/trigger-completion.h
index 5bf596e4e..694f1a7e4 100644
--- a/src/plugins/trigger/trigger-completion.h
+++ b/src/plugins/trigger/trigger-completion.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -17,9 +17,9 @@
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef WEECHAT_TRIGGER_COMPLETION_H
-#define WEECHAT_TRIGGER_COMPLETION_H 1
+#ifndef WEECHAT_PLUGIN_TRIGGER_COMPLETION_H
+#define WEECHAT_PLUGIN_TRIGGER_COMPLETION_H
extern void trigger_completion_init ();
-#endif /* WEECHAT_TRIGGER_COMPLETION_H */
+#endif /* WEECHAT_PLUGIN_TRIGGER_COMPLETION_H */
diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c
index c85548ab7..8edd61b79 100644
--- a/src/plugins/trigger/trigger-config.c
+++ b/src/plugins/trigger/trigger-config.c
@@ -1,7 +1,7 @@
/*
* trigger-config.c - trigger configuration options (file trigger.conf)
*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -661,6 +661,7 @@ trigger_config_init ()
if (!ptr_section)
{
weechat_config_free (trigger_config_file);
+ trigger_config_file = NULL;
return 0;
}
@@ -690,6 +691,7 @@ trigger_config_init ()
if (!ptr_section)
{
weechat_config_free (trigger_config_file);
+ trigger_config_file = NULL;
return 0;
}
@@ -761,6 +763,7 @@ trigger_config_init ()
if (!ptr_section)
{
weechat_config_free (trigger_config_file);
+ trigger_config_file = NULL;
return 0;
}
diff --git a/src/plugins/trigger/trigger-config.h b/src/plugins/trigger/trigger-config.h
index 651cc93f9..05b9515b1 100644
--- a/src/plugins/trigger/trigger-config.h
+++ b/src/plugins/trigger/trigger-config.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -17,8 +17,8 @@
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef WEECHAT_TRIGGER_CONFIG_H
-#define WEECHAT_TRIGGER_CONFIG_H 1
+#ifndef WEECHAT_PLUGIN_TRIGGER_CONFIG_H
+#define WEECHAT_PLUGIN_TRIGGER_CONFIG_H
#define TRIGGER_CONFIG_NAME "trigger"
#define TRIGGER_CONFIG_SECTION_TRIGGER "trigger"
@@ -49,4 +49,4 @@ extern int trigger_config_read ();
extern int trigger_config_write ();
extern void trigger_config_free ();
-#endif /* WEECHAT_TRIGGER_CONFIG_H */
+#endif /* WEECHAT_PLUGIN_TRIGGER_CONFIG_H */
diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c
index 4cd2e7272..b088b1f0e 100644
--- a/src/plugins/trigger/trigger.c
+++ b/src/plugins/trigger/trigger.c
@@ -1,7 +1,7 @@
/*
* trigger.c - trigger plugin for WeeChat
*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -38,7 +38,7 @@ WEECHAT_PLUGIN_DESCRIPTION(N_("Text replacement and command execution on events
WEECHAT_PLUGIN_AUTHOR("Sébastien Helleu <flashcode@flashtux.org>");
WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION);
WEECHAT_PLUGIN_LICENSE(WEECHAT_LICENSE);
-WEECHAT_PLUGIN_PRIORITY(11000);
+WEECHAT_PLUGIN_PRIORITY(12000);
struct t_weechat_plugin *weechat_trigger_plugin = NULL;
diff --git a/src/plugins/trigger/trigger.h b/src/plugins/trigger/trigger.h
index 0237962a9..78984277b 100644
--- a/src/plugins/trigger/trigger.h
+++ b/src/plugins/trigger/trigger.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2014-2018 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -17,8 +17,8 @@
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef WEECHAT_TRIGGER_H
-#define WEECHAT_TRIGGER_H 1
+#ifndef WEECHAT_PLUGIN_TRIGGER_H
+#define WEECHAT_PLUGIN_TRIGGER_H
#include <regex.h>
@@ -170,4 +170,4 @@ extern struct t_trigger *trigger_copy (struct t_trigger *trigger,
extern void trigger_free (struct t_trigger *trigger);
extern void trigger_free_all ();
-#endif /* WEECHAT_TRIGGER_H */
+#endif /* WEECHAT_PLUGIN_TRIGGER_H */