summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-curses-color.c2
-rw-r--r--src/gui/curses/gui-curses-main.c17
-rw-r--r--src/gui/curses/gui-curses-window.c4
-rw-r--r--src/gui/gui-completion.c4
-rw-r--r--src/gui/gui-keyboard.c4
5 files changed, 19 insertions, 12 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index 073fcd74d..cacb8ec46 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -98,7 +98,7 @@ gui_color_get_fg_bg (char *string, char **fg, char **bg)
{
pos_end_fg--;
}
- *fg = strndup (string, pos_end_fg - string + 1);
+ *fg = string_strndup (string, pos_end_fg - string + 1);
}
else
*fg = strudp ("default");
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 793ad9e78..e0f9e2547 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -30,6 +30,7 @@
#include <signal.h>
#include "../../core/weechat.h"
+#include "../../core/wee-command.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-string.h"
@@ -119,7 +120,7 @@ gui_main_init ()
}
/*
- * gui_main_quit: quit weechat (signal received)
+ * gui_main_quit: quit WeeChat
*/
void
@@ -129,6 +130,16 @@ gui_main_quit ()
}
/*
+ * gui_main_reload: reload WeeChat configuration
+ */
+
+void
+gui_main_reload ()
+{
+ command_reload (NULL, NULL, 0, NULL, NULL);
+}
+
+/*
* gui_main_loop: main loop for WeeChat with ncurses GUI
*/
@@ -147,8 +158,8 @@ gui_main_loop ()
/* catch SIGTERM signal: quit program */
util_catch_signal (SIGTERM, &gui_main_quit);
- /* cach SIGHUP signal: reload configuration */
- util_catch_signal (SIGHUP, &gui_main_quit);
+ /* catch SIGHUP signal: reload configuration */
+ util_catch_signal (SIGHUP, &gui_main_reload);
/* catch SIGWINCH signal: redraw screen */
util_catch_signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 3742a857f..69af89496 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -24,10 +24,7 @@
#endif
#include <stdlib.h>
-#include <stdarg.h>
#include <string.h>
-#include <signal.h>
-#include <libgen.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
@@ -1334,7 +1331,6 @@ gui_window_refresh_screen_sigwinch ()
{
gui_window_refresh_needed = 1;
//gui_window_refresh_screen (0);
- signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);
}
/*
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index fde152aef..20bec9132 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -710,8 +710,8 @@ gui_completion_build_list_template (struct t_gui_completion *completion,
{
if (pos_end > pos)
{
- custom_completion = strndup (pos,
- pos_end - pos);
+ custom_completion = string_strndup (pos,
+ pos_end - pos);
if (custom_completion)
{
gui_completion_custom (completion,
diff --git a/src/gui/gui-keyboard.c b/src/gui/gui-keyboard.c
index 195d12b38..47aec611c 100644
--- a/src/gui/gui-keyboard.c
+++ b/src/gui/gui-keyboard.c
@@ -405,7 +405,7 @@ gui_keyboard_new (char *key, char *command, t_gui_key_func *function, char *args
{
length = strlen (args);
if ((length > 1) && (args[length - 1] == '"'))
- new_key->args = strndup (args + 1, length - 2);
+ new_key->args = string_strndup (args + 1, length - 2);
else
new_key->args = strdup (args);
}
@@ -544,7 +544,7 @@ gui_keyboard_bind (char *key, char *command)
{
ptr_args = strchr (command, ' ');
if (ptr_args)
- command2 = strndup (command, ptr_args - command);
+ command2 = string_strndup (command, ptr_args - command);
else
command2 = strdup (command);
if (command2)