gtkmain: walk GTK_LOCALEDIR through a pointer, not the literal

This commit is contained in:
Daemonratte 2026-10-19 14:03:48 +02:00
commit 9efadc7e36

View file

@ -124,13 +124,14 @@ _gtk_get_localedir (void)
static char *gtk_localedir = NULL;
if (gtk_localedir == NULL)
{
const gchar *localedir = GTK_LOCALEDIR;
const gchar *p;
gchar *root, *temp;
/* GTK_LOCALEDIR ends in either /lib/locale or
* /share/locale. Scan for that slash.
*/
p = GTK_LOCALEDIR + strlen (GTK_LOCALEDIR);
p = localedir + strlen (localedir);
while (*--p != '/')
;
while (*--p != '/')