1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

Compare commits

...

23 Commits

Author SHA1 Message Date
Sébastien Helleu e050eebb2e api: return input string in function string_iconv_from_internal when current locale is wrong
This fixes a bug when writing configuration files with a wrong locale: now
UTF-8 is kept and written in files instead of string converted using a wrong
charset.
2025-03-02 13:46:21 +01:00
Sébastien Helleu e8a7869722 Version 4.5.3-dev 2025-02-20 23:40:51 +01:00
Sébastien Helleu 3e8f957210 Version 4.5.2 2025-02-20 23:37:24 +01:00
Sébastien Helleu 1110b8b9d5 debian: update changelog 2025-02-20 23:05:45 +01:00
Sébastien Helleu 524528fc34 core: update ChangeLog 2025-02-20 22:55:00 +01:00
LuK1337 34c79971fc core: use <stdbool.h> instead of typedef in ncurses-fake.h
Fixes the following error when building in Fedora rawhide:
error: ‘bool’ cannot be defined via ‘typedef’.

Likely GCC 15 related.
2025-01-26 08:55:36 +01:00
Sébastien Helleu c1ca6c4002 core: add parameter name in signal handler functions 2025-01-26 08:55:34 +01:00
LuK1337 c7af60daaa core: add int arg for all sigaction.sa_handler functions
src/gui/curses/gui-curses-main.c: In function ‘gui_main_loop’:
src/gui/curses/gui-curses-main.c:399:33: error: passing argument 2 of ‘signal_catch’ from incompatible pointer type [-Wincompatible-pointer-types]
  399 |         signal_catch (SIGWINCH, &gui_main_signal_sigwinch);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 void (*)(void)
In file included from src/gui/curses/gui-curses-main.c:38:
src/gui/curses/../../core/core-signal.h:33:46: note: expected ‘void (*)(int)’ but argument is of type ‘void (*)(void)’
   33 | extern void signal_catch (int signum, void (*handler)(int));
      |                                       ~~~~~~~^~~~~~~~~~~~~
2025-01-26 08:55:32 +01:00
Sébastien Helleu 99a3865665 relay/api: bump version in OpenAPI document 2025-01-05 13:44:17 +01:00
Sébastien Helleu b93a24d949 relay/api: fix name of body field "buffer_name" in doc of POST /api/input 2025-01-05 10:36:59 +01:00
Sébastien Helleu 1ee6b6e635 Version 4.5.2-dev 2024-12-23 08:52:56 +01:00
Sébastien Helleu b62c87d9eb Version 4.5.1 2024-12-23 08:47:56 +01:00
Sébastien Helleu 18be2b3151 core: fix typo in ChangeLog 2024-12-23 08:37:06 +01:00
Sébastien Helleu 8a9a652d03 relay: fix description of relay clients after /upgrade 2024-12-22 19:34:31 +01:00
Sébastien Helleu f8c48b8000 relay: fix crash after /upgrade when relay clients are connected 2024-12-22 19:34:29 +01:00
Sébastien Helleu 42c65cebcb api: allow to add empty buffer with function infolist_new_var_buffer
This fixes the following error with `/upgrade` command when relay clients are
connected:

  relay: failed to save upgrade data
2024-12-22 19:34:20 +01:00
Sébastien Helleu c9c57eeee2 Revert "ci: fix macOS CI"
Remove workaround for https://github.com/actions/runner-images/issues/10984

This reverts commit 2555c378a2.
2024-12-22 10:56:07 +01:00
Sébastien Helleu 8c63243941 core: fix detection of dl library (issue #2218)
This fixes the linking to curl and ncurses on macOS.
2024-12-21 18:11:57 +01:00
Sébastien Helleu 732bfe4a48 core: add option POST_BUILD in add_custom_command
This fixes the following CMake warning:

CMake Warning (dev) at src/gui/curses/normal/CMakeLists.txt:73 (add_custom_command):
  Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given.  Assuming
  POST_BUILD to preserve backward compatibility.

  Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
  Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.
2024-12-21 18:11:08 +01:00
Sébastien Helleu 46f322c10f logger: fix path displayed when the logs directory can not be created 2024-12-21 17:16:15 +01:00
Sébastien Helleu 52cb5bbbe0 core: update ChangeLog 2024-12-20 07:39:18 +01:00
zeromind b634270f2a perl: set locale only on supported Perl versions
restrict setting the locale only if the Perl version supports it (>=5.27.9)

fixes #2219
2024-12-20 07:38:33 +01:00
Sébastien Helleu f4dbdb93d7 Version 4.5.1-dev 2024-12-20 07:38:14 +01:00
22 changed files with 121 additions and 41 deletions
+1 -3
View File
@@ -381,9 +381,7 @@ jobs:
/usr/local/bin/python3.11 \
/usr/local/bin/python3.11-config \
;
# workaround for https://github.com/actions/runner-images/issues/10984
brew uninstall --ignore-dependencies --force pkg-config@0.29.2
brew install asciidoctor aspell cjson guile lua ruby
brew install asciidoctor aspell cjson guile lua pkg-config ruby
- uses: actions/checkout@v4
+22
View File
@@ -1,5 +1,27 @@
# WeeChat ChangeLog
## Version 4.5.3 (under dev)
### Fixed
- core: save configuration files as UTF-8 when the locale is wrong
## Version 4.5.2 (2025-02-20)
### Fixed
- core: fix build with gcc 15 ([#2229](https://github.com/weechat/weechat/issues/2229), [#2230](https://github.com/weechat/weechat/issues/2230))
## Version 4.5.1 (2024-12-23)
### Fixed
- relay: fix crash after `/upgrade` when relay clients are connected
- api: fix creation of empty buffer in function infolist_new_var_buffer
- core: fix detection of dl library ([#2218](https://github.com/weechat/weechat/issues/2218))
- logger: fix path displayed when the logs directory can not be created
- perl: fix build with Perl < 5.7.29 ([#2219](https://github.com/weechat/weechat/issues/2219), [#2220](https://github.com/weechat/weechat/issues/2220))
## Version 4.5.0 (2024-12-15)
### Changed
+1 -3
View File
@@ -247,9 +247,7 @@ find_library(DL_LIBRARY
PATHS /lib /usr/lib /usr/libexec /usr/local/lib /usr/local/libexec
)
if(DL_LIBRARY)
string(REGEX REPLACE "/[^/]*$" "" DL_LIBRARY_PATH "${DL_LIBRARY}")
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${DL_LIBRARY_PATH}")
list(APPEND EXTRA_LIBS dl)
list(APPEND EXTRA_LIBS ${DL_LIBRARY})
endif()
add_subdirectory(icons)
+7
View File
@@ -1,3 +1,10 @@
weechat (4.5.1-1) unstable; urgency=medium
* New upstream release
* Update copyright file (new year)
-- Emmanuel Bouthenot <kolter@debian.org> Mon, 20 Jan 2025 14:39:42 +0000
weechat (4.4.3-1) unstable; urgency=medium
* New upstream release
+2 -2
View File
@@ -1184,7 +1184,7 @@ Body parameters:
* `buffer_id` (integer, optional): buffer unique identifier (not to be confused
with the buffer number, which is different)
* `buffer` (string, optional, default: `core.weechat`): buffer name
* `buffer_name` (string, optional, default: `core.weechat`): buffer name
* `command` (string, **required**): command or text to send to the buffer
Request example: say "hello!" on channel #weechat:
@@ -1192,7 +1192,7 @@ Request example: say "hello!" on channel #weechat:
[source,shell]
----
curl -L -u 'plain:secret_password' -X POST \
-d '{"buffer": "irc.libera.#weechat", "command": "hello!"}' \
-d '{"buffer_name": "irc.libera.#weechat", "command": "hello!"}' \
'https://localhost:9000/api/input'
----
+2 -2
View File
@@ -1196,7 +1196,7 @@ Paramètres du corps :
* `buffer_id` (entier, facultatif) : identifiant unique du tampon (à ne pas
confondre avec le numéro du tampon, qui est différent)
* `buffer_name` (chaîne, facultatif) : nom de tampon
* `buffer_name` (chaîne, facultatif, par défaut: `core.weechat`) : nom de tampon
* `command` (chaîne, **obligatoire**) : commande ou texte à envoyer au tampon
Exemple de requête : dire "hello!" sur le canal #weechat :
@@ -1204,7 +1204,7 @@ Exemple de requête : dire "hello!" sur le canal #weechat :
[source,shell]
----
curl -L -u 'plain:secret_password' -X POST \
-d '{"buffer": "irc.libera.#weechat", "command": "hello!"}' \
-d '{"buffer_name": "irc.libera.#weechat", "command": "hello!"}' \
'https://localhost:9000/api/input'
----
+4 -1
View File
@@ -228,8 +228,11 @@ debug_dump_cb (const void *pointer, void *data,
*/
void
debug_sigsegv_cb ()
debug_sigsegv_cb (int signo)
{
/* make C compiler happy */
(void) signo;
debug_dump (1);
unhook_all ();
gui_main_end (0);
+1 -1
View File
@@ -27,7 +27,7 @@ struct t_gui_window_tree;
extern long long debug_long_callbacks;
extern void debug_build_info ();
extern void debug_sigsegv_cb ();
extern void debug_sigsegv_cb (int signo);
extern void debug_windows_tree ();
extern void debug_memory ();
extern void debug_hdata ();
+14 -4
View File
@@ -247,17 +247,27 @@ infolist_new_var_buffer (struct t_infolist_item *item,
{
struct t_infolist_var *new_var;
if (!item || !name || !name[0] || (size <= 0))
if (!item || !name || !name[0])
return NULL;
if (size < 0)
size = 0;
new_var = malloc (sizeof (*new_var));
if (new_var)
{
new_var->name = strdup (name);
new_var->type = INFOLIST_BUFFER;
new_var->value = malloc (size);
if (new_var->value)
memcpy (new_var->value, pointer, size);
if (pointer && (size > 0))
{
new_var->value = malloc (size);
if (new_var->value)
memcpy (new_var->value, pointer, size);
}
else
{
new_var->value = NULL;
}
new_var->size = size;
new_var->prev_var = item->last_var;
+20 -5
View File
@@ -65,8 +65,11 @@ volatile sig_atomic_t signal_sigusr2_count = 0;
*/
void
signal_sighup_cb ()
signal_sighup_cb (int signo)
{
/* make C compiler happy */
(void) signo;
signal_sighup_count++;
}
@@ -75,8 +78,11 @@ signal_sighup_cb ()
*/
void
signal_sigquit_cb ()
signal_sigquit_cb (int signo)
{
/* make C compiler happy */
(void) signo;
signal_sigquit_count++;
}
@@ -85,8 +91,11 @@ signal_sigquit_cb ()
*/
void
signal_sigterm_cb ()
signal_sigterm_cb (int signo)
{
/* make C compiler happy */
(void) signo;
signal_sigterm_count++;
}
@@ -95,8 +104,11 @@ signal_sigterm_cb ()
*/
void
signal_sigusr1_cb ()
signal_sigusr1_cb (int signo)
{
/* make C compiler happy */
(void) signo;
signal_sigusr1_count++;
}
@@ -105,8 +117,11 @@ signal_sigusr1_cb ()
*/
void
signal_sigusr2_cb ()
signal_sigusr2_cb (int signo)
{
/* make C compiler happy */
(void) signo;
signal_sigusr2_count++;
}
+6 -1
View File
@@ -3253,7 +3253,8 @@ string_iconv_to_internal (const char *charset, const char *string)
}
/*
* Converts internal string to terminal charset, for display.
* Converts internal string to terminal charset, for display or write of
* configuration files.
*
* Note: result must be freed after use.
*/
@@ -3270,6 +3271,10 @@ string_iconv_from_internal (const char *charset, const char *string)
if (!input)
return NULL;
/* if the locale is wrong, we keep UTF-8 */
if (!weechat_locale_ok)
return input;
/*
* optimized for UTF-8: if charset is NULL => we use term charset => if
* this charset is already UTF-8, then no iconv is needed
+1
View File
@@ -118,6 +118,7 @@ extern char *weechat_data_dir;
extern char *weechat_state_dir;
extern char *weechat_cache_dir;
extern char *weechat_runtime_dir;
extern int weechat_locale_ok;
extern char *weechat_local_charset;
extern int weechat_plugin_no_dlclose;
extern int weechat_no_gnutls;
+8 -2
View File
@@ -150,8 +150,11 @@ gui_main_get_password (const char **prompt, char *password, int size)
*/
void
gui_main_signal_sigint ()
gui_main_signal_sigint (int signo)
{
/* make C compiler happy */
(void) signo;
weechat_quit = 1;
}
@@ -253,8 +256,11 @@ gui_main_init ()
*/
void
gui_main_signal_sigwinch ()
gui_main_signal_sigwinch (int signo)
{
/* make C compiler happy */
(void) signo;
gui_signal_sigwinch_received = 1;
}
+1 -1
View File
@@ -20,6 +20,7 @@
#ifndef WEECHAT_NCURSES_FAKE_H
#define WEECHAT_NCURSES_FAKE_H
#include <stdbool.h>
#include <stddef.h>
#define ERR (-1)
@@ -71,7 +72,6 @@ struct _window
};
typedef struct _window WINDOW;
typedef unsigned char bool;
typedef int attr_t;
typedef unsigned chtype;
+1
View File
@@ -72,6 +72,7 @@ target_link_libraries(${EXECUTABLE}
# It may be removed in future.
add_custom_command(
TARGET ${EXECUTABLE}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove -f "weechat-curses${CMAKE_EXECUTABLE_SUFFIX}"
COMMAND ${CMAKE_COMMAND} -E create_symlink "weechat${CMAKE_EXECUTABLE_SUFFIX}" "weechat-curses${CMAKE_EXECUTABLE_SUFFIX}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
-8
View File
@@ -265,15 +265,7 @@ logger_buffer_create_log_file (struct t_logger_buffer *logger_buffer)
/* create directory */
if (!logger_create_directory ())
{
weechat_printf_date_tags (
NULL, 0, "no_log",
_("%s%s: unable to create directory for logs "
"(\"%s\")"),
weechat_prefix ("error"), LOGGER_PLUGIN_NAME,
weechat_config_string (logger_config_file_path));
return 0;
}
if (!logger_buffer->log_filename)
logger_buffer_set_log_filename (logger_buffer);
if (!logger_buffer->log_filename)
+8
View File
@@ -182,7 +182,15 @@ logger_create_directory ()
if (file_path)
{
if (!weechat_mkdir_parents (file_path, 0700))
{
weechat_printf_date_tags (
NULL, 0, "no_log",
_("%s%s: unable to create directory for logs "
"(\"%s\")"),
weechat_prefix ("error"), LOGGER_PLUGIN_NAME,
file_path);
rc = 0;
}
free (file_path);
}
else
+8
View File
@@ -579,11 +579,15 @@ weechat_perl_load (const char *filename, const char *code)
wcwidth160 = wcwidth (160);
perl_construct (perl_current_interpreter);
#if PERL_REVISION >= 6 || (PERL_REVISION == 5 && PERL_VERSION >= 28) || (PERL_REVISION == 5 && PERL_VERSION == 27 && PERL_SUBVERSION >= 9)
if (wcwidth (160) != wcwidth160)
{
/* restore the locale that's broken in some versions of Perl */
Perl_setlocale (LC_ALL, "");
}
#else
(void) wcwidth160;
#endif
temp_script.interpreter = (PerlInterpreter *) perl_current_interpreter;
perl_parse (perl_current_interpreter, weechat_perl_api_init,
@@ -1320,11 +1324,15 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
wcwidth160 = wcwidth (160);
perl_construct (perl_main);
#if PERL_REVISION >= 6 || (PERL_REVISION == 5 && PERL_VERSION >= 28) || (PERL_REVISION == 5 && PERL_VERSION == 27 && PERL_SUBVERSION >= 9)
if (wcwidth (160) != wcwidth160)
{
/* restore the locale that's broken in some versions of Perl */
Perl_setlocale (LC_ALL, "");
}
#else
(void) wcwidth160;
#endif
perl_parse (perl_main, weechat_perl_api_init, perl_args_count,
perl_args, NULL);
+3 -3
View File
@@ -994,7 +994,7 @@ error:
* {
* "request": "POST /api/input",
* "body": {
* "buffer": "irc.libera.#weechat",
* "buffer_name": "irc.libera.#weechat",
* "command": "hello!"
* }
* }
@@ -1002,10 +1002,10 @@ error:
* It is converted to an HTTP request which could have been:
*
* POST /api/input HTTP/1.1
* Content-Length: 53
* Content-Length: 58
* Content-Type: application/json
*
* {"buffer": "irc.libera.#weechat","command": "hello!"}
* {"buffer_name": "irc.libera.#weechat","command": "hello!"}
*
* The JSON can also be an array of requests, for example to fetch all buffers
* data and synchronize at same time:
+2 -2
View File
@@ -13,7 +13,7 @@ info:
license:
name: CC BY-NC-SA 4.0
url: https://creativecommons.org/licenses/by-nc-sa/4.0/
version: 0.2.0
version: 0.3.0
externalDocs:
url: https://weechat.org/doc/
@@ -991,7 +991,7 @@ components:
format: int64
description: Buffer identifier (≥ 0)
example: 1709932823238637
buffer:
buffer_name:
type: string
description: >-
Buffer full name
+7 -1
View File
@@ -1589,7 +1589,8 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
if (new_client)
{
new_client->id = weechat_infolist_integer (infolist, "id");
new_client->desc = NULL;
str = weechat_infolist_string (infolist, "desc");
new_client->desc = (str) ? strdup (str) : NULL;
new_client->sock = weechat_infolist_integer (infolist, "sock");
new_client->server_port = weechat_infolist_integer (infolist, "server_port");
/* "tls" replaces "ssl" in WeeChat 4.0.0 */
@@ -1696,6 +1697,11 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
new_client->partial_ws_frame_size = ws_frame_size;
}
}
else
{
new_client->partial_ws_frame = NULL;
new_client->partial_ws_frame_size = 0;
}
str = weechat_infolist_string (infolist, "partial_message");
new_client->partial_message = (str) ? strdup (str) : NULL;
+2 -2
View File
@@ -39,8 +39,8 @@
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
#
weechat_stable="4.5.0"
weechat_devel="4.5.0"
weechat_stable="4.5.2"
weechat_devel="4.5.3-dev"
stable_major=$(echo "${weechat_stable}" | cut -d"." -f1)
stable_minor=$(echo "${weechat_stable}" | cut -d"." -f2)