diff --git a/locale.c b/locale.c index 1d46b5d3dadc..ae3a33f8876f 100644 --- a/locale.c +++ b/locale.c @@ -5667,6 +5667,19 @@ S_my_localeconv(pTHX_ const int item) strings, integers ); +# ifndef HAS_SOME_LANGINFO /* Could be using this function to emulate + nl_langinfo() */ + + /* We are done when called with an individual item. There are no integer + * items to adjust, and it's best for the caller to determine if this + * string item is UTF-8 or not. This is because the locale's UTF-8ness is + * calculated below, and in some Configurations, that can lead to a + * recursive call to here, which could recurse infinitely. */ + if (item != 0) { + return hv; + } + +# endif /* The above call may have done all the hash fields, but not always, as * already explained. If we need a second call it is always for the @@ -5701,20 +5714,6 @@ S_my_localeconv(pTHX_ const int item) * cost which khw doesn't think is worth it */ -# ifndef HAS_SOME_LANGINFO - - /* We are done when called with an individual item. There are no integer - * items to adjust, and it's best for the caller to determine if this - * string item is UTF-8 or not. This is because the locale's UTF-8ness is - * calculated below, and in some Configurations, that can lead to a - * recursive call to here, which could recurse infinitely. */ - - if (item != 0) { - return hv; - } - -# endif - for (unsigned int i = 0; i < 2; i++) { /* Try both types of strings */ if (! strings[i]) { /* Skip if no strings of this type */ continue;