mirror of
https://github.com/irssi/irssi.git
synced 2026-08-19 00:22:17 +02:00
Merge pull request #1510 from ailin-nemui/perl-again
restore locale if perl breaks it
(cherry picked from commit 504fd7bc60)
This commit is contained in:
parent
bcf07a2546
commit
adad0a2fa4
2 changed files with 21 additions and 11 deletions
|
|
@ -52,10 +52,3 @@ sub eval_file {
|
||||||
die "cap_sasl has been unloaded from Irssi ".Irssi::version()." because it conflicts with the built-in SASL support. See /help network for configuring SASL or read the ChangeLog for more information.";
|
die "cap_sasl has been unloaded from Irssi ".Irssi::version()." because it conflicts with the built-in SASL support. See /help network for configuring SASL or read the ChangeLog for more information.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $] >= 5.037005 && $] <= 5.038000 ) {
|
|
||||||
# https://github.com/Perl/perl5/issues/21366
|
|
||||||
print STDERR "\e7 \e[A Irssi: applying locale workaround for Perl 5.38.0 \e8";
|
|
||||||
require POSIX;
|
|
||||||
POSIX::setlocale(&POSIX::LC_ALL, "");
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -111,13 +111,16 @@ static void xs_init(pTHX)
|
||||||
void perl_scripts_init(void)
|
void perl_scripts_init(void)
|
||||||
{
|
{
|
||||||
char *code, *use_code;
|
char *code, *use_code;
|
||||||
|
int broken_perl;
|
||||||
|
|
||||||
perl_scripts = NULL;
|
perl_scripts = NULL;
|
||||||
perl_sources_start();
|
perl_sources_start();
|
||||||
perl_signals_start();
|
perl_signals_start();
|
||||||
|
|
||||||
my_perl = perl_alloc();
|
my_perl = perl_alloc();
|
||||||
|
broken_perl = wcwidth(160);
|
||||||
perl_construct(my_perl);
|
perl_construct(my_perl);
|
||||||
|
broken_perl = broken_perl != wcwidth(160);
|
||||||
|
|
||||||
perl_parse(my_perl, xs_init, G_N_ELEMENTS(perl_args) - 1, perl_args, NULL);
|
perl_parse(my_perl, xs_init, G_N_ELEMENTS(perl_args) - 1, perl_args, NULL);
|
||||||
#if PERL_STATIC_LIBS == 1
|
#if PERL_STATIC_LIBS == 1
|
||||||
|
|
@ -129,6 +132,20 @@ void perl_scripts_init(void)
|
||||||
use_code = perl_get_use_list();
|
use_code = perl_get_use_list();
|
||||||
code = g_strdup_printf(irssi_core_code, PERL_STATIC_LIBS, use_code);
|
code = g_strdup_printf(irssi_core_code, PERL_STATIC_LIBS, use_code);
|
||||||
perl_eval_pv(code, TRUE);
|
perl_eval_pv(code, TRUE);
|
||||||
|
if (broken_perl) {
|
||||||
|
g_warning("applying locale workaround for Perl %d.%d, see "
|
||||||
|
"https://github.com/Perl/perl5/issues/21366",
|
||||||
|
PERL_REVISION, PERL_VERSION);
|
||||||
|
perl_eval_pv("package Irssi::Core;"
|
||||||
|
/* https://github.com/Perl/perl5/issues/21746 */
|
||||||
|
"if ( $] == $] )"
|
||||||
|
"{"
|
||||||
|
"require POSIX;"
|
||||||
|
"POSIX::setlocale(&POSIX::LC_ALL, \"\");"
|
||||||
|
"}"
|
||||||
|
"1;",
|
||||||
|
TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
g_free(code);
|
g_free(code);
|
||||||
g_free(use_code);
|
g_free(use_code);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue