Skip to content

fix hang caused by Gtk3 -init breaking float arithmetic in non-C locales#264

Open
bor wants to merge 1 commit intosquentin:masterfrom
bor:fix/locale_float_hang
Open

fix hang caused by Gtk3 -init breaking float arithmetic in non-C locales#264
bor wants to merge 1 commit intosquentin:masterfrom
bor:fix/locale_float_hang

Conversation

@bor
Copy link

@bor bor commented Feb 16, 2026

Gtk3's gtk_init() calls setlocale(LC_ALL, "") which sets LC_NUMERIC to the user's locale. In locales using comma as decimal separator (e.g. uk_UA.UTF-8), this causes Perl to misinterpret float literals like .8 as 0, making Breakdown_List loop infinitely with $max=0.

use locale :numeric tells Perl to properly manage LC_NUMERIC, keeping C locale for arithmetic while respecting user locale for display.

Resolves #253

Gtk3's gtk_init() calls setlocale(LC_ALL, "") which sets LC_NUMERIC to
the user's locale. In locales using comma as decimal separator (e.g.
uk_UA.UTF-8), this causes Perl to misinterpret float literals like .8
as 0, making Breakdown_List loop infinitely with $max=0.

use locale :numeric tells Perl to properly manage LC_NUMERIC, keeping
C locale for arithmetic while respecting user locale for display.

Resolves squentin#253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gmusicbrowser encounters errors after the latest Perl update to version 5.38

1 participant