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

Fix crash when unloading Perl scripts with Perl 5.38

Apparently the issue with the locale being reset with Perl 5.38 can
cause a crash when unloading the scripts on some systems (at least
Ubuntu 24.04). There was a workaround added in commit f4b9cad72, but it
doesn't work to avoid the crash. However if we set LC_ALL instead of
LC_CTYPE the crash doesn't occur.

Fixes #2187
This commit is contained in:
Trygve Aaberge
2024-11-13 12:46:13 +01:00
committed by Sébastien Helleu
parent 5bdbcae892
commit 9250d769fd
+2 -2
View File
@@ -570,7 +570,7 @@ weechat_perl_load (const char *filename, const char *code)
perl_args_count, perl_args, NULL);
#if PERL_REVISION >= 6 || (PERL_REVISION == 5 && PERL_VERSION >= 38)
/* restore the locale that could be changed by Perl >= 5.38 */
Perl_setlocale (LC_CTYPE, "");
Perl_setlocale (LC_ALL, "");
#endif
length = strlen (perl_weechat_code) + strlen (str_warning) +
strlen (str_error) - 2 + 4 + strlen ((code) ? code : filename) + 4 + 1;
@@ -1303,7 +1303,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
perl_args, NULL);
#if PERL_REVISION >= 6 || (PERL_REVISION == 5 && PERL_VERSION >= 38)
/* restore the locale that could be changed by Perl >= 5.38 */
Perl_setlocale (LC_CTYPE, "");
Perl_setlocale (LC_ALL, "");
#endif
#endif /* MULTIPLICITY */