This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Fix comment
[perl5.git] / numeric.c
index 7514b74..7065486 100644 (file)
--- a/numeric.c
+++ b/numeric.c
@@ -1212,11 +1212,18 @@ Perl_my_atof(pTHX_ const char* s)
     /* 's' must be NUL terminated */
 
     NV x = 0.0;
+
+    PERL_ARGS_ASSERT_MY_ATOF;
+
 #ifdef USE_QUADMATH
+
     Perl_my_atof2(aTHX_ s, &x);
-    return x;
-#elif defined(USE_LOCALE_NUMERIC)
-    PERL_ARGS_ASSERT_MY_ATOF;
+
+#elif ! defined(USE_LOCALE_NUMERIC)
+
+    Perl_atof2(s, x);
+
+#else
 
     {
         DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
@@ -1229,9 +1236,11 @@ Perl_my_atof(pTHX_ const char* s)
              * that we have to determine this beforehand because on some
              * systems, Perl_atof2 is just a wrapper around the system's atof.
              * */
-            const char * const standard = strchr(s, '.');
-            const char * const local = strstr(s, SvPV_nolen(PL_numeric_radix_sv));
-            const bool use_standard_radix = standard && (!local || standard < local);
+            const char * const standard_pos = strchr(s, '.');
+            const char * const local_pos
+                                  = strstr(s, SvPV_nolen(PL_numeric_radix_sv));
+            const bool use_standard_radix
+                    = standard_pos && (!local_pos || standard_pos < local_pos);
 
             if (use_standard_radix)
                 SET_NUMERIC_STANDARD();
@@ -1245,9 +1254,9 @@ Perl_my_atof(pTHX_ const char* s)
             Perl_atof2(s, x);
         RESTORE_LC_NUMERIC();
     }
-#else
-    Perl_atof2(s, x);
+
 #endif
+
     return x;
 }