Skip to content

Commit

Permalink
locale.c: Complement initialization of boolean
Browse files Browse the repository at this point in the history
This was my attempt to make the difference listing in the next commit
smaller, but it didn't help much.
  • Loading branch information
khwilliamson committed May 12, 2023
1 parent 276411e commit 13f5a4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions locale.c
Expand Up @@ -6079,13 +6079,15 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
* values for our db, instead of trying to change them.
* */

int ok = 1;

#ifndef USE_LOCALE

PERL_UNUSED_ARG(printwarn);
const int ok = 1;

#else /* USE_LOCALE */

int ok = 0;

# ifdef __GLIBC__

const char * const language = PerlEnv_getenv("LANGUAGE");
Expand Down Expand Up @@ -6392,13 +6394,11 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
}

if (LIKELY(! setlocale_failure)) { /* All succeeded */
ok = 1;
break; /* Exit trial_locales loop */
}
}

/* Here, something failed; will need to try a fallback. */
ok = 0;

if (i == 0) {
unsigned int j;

Expand Down Expand Up @@ -6532,7 +6532,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
} /* end of first time through the loop */
} /* end of looping through the trial locales */

if (ok < 1) { /* If we tried to fallback */
if (trial_locales_count > 1) { /* If we tried to fallback */
const char* msg;
if (! setlocale_failure) { /* fallback succeeded */
msg = "Falling back to";
Expand Down

0 comments on commit 13f5a4f

Please sign in to comment.