locale_facets.tcc (money_get::do_get(..., string_type&): Minor tweak to the previous...
authorPaolo Carlini <pcarlini@suse.de>
Fri, 24 Oct 2003 12:21:18 +0000 (12:21 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 24 Oct 2003 12:21:18 +0000 (12:21 +0000)
2003-10-24  Paolo Carlini  <pcarlini@suse.de>

* include/bits/locale_facets.tcc (money_get::do_get(...,
string_type&): Minor tweak to the previous commit.

From-SVN: r72892

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc

index 7842ab56f7819cf322ffec05425906ae7415c4a4..2b96b005b3c6b527543243196b050d56ca724fa5 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-24  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/locale_facets.tcc (money_get::do_get(...,
+       string_type&): Minor tweak to the previous commit.
+
 2003-10-24  Paolo Carlini  <pcarlini@suse.de>
 
        * include/bits/locale_facets.tcc (money_get::do_get(...,
index f025c5125a944ab59a76b9441d2ea9fbb6110034..5e8128efa7bdcbbf87d3bf4e3b8e4490e0a3cc23 100644 (file)
@@ -1284,7 +1284,7 @@ namespace std
            __testvalid = false;
        }
 
-      if (__testvalid)
+      if (__testvalid && __tmp_units.size())
        {
          const char_type __zero = __ctype.widen('0');
 
@@ -1297,33 +1297,30 @@ namespace std
                __tmp_units.erase(0, __only_zeros ? __tmp_units.size() - 1
                                                  : __first);
            }
+         
+         // 22.2.6.1.2, p4
+         if (__sign.size() && __sign == __neg_sign
+             && __tmp_units[0] != __zero)
+           __tmp_units.insert(__tmp_units.begin(), __ctype.widen('-'));
 
-         if (__tmp_units.size())
+         // Test for grouping fidelity.
+         if (__grouping.size() && __grouping_tmp.size())
            {
-             // 22.2.6.1.2, p4
-             if (__sign.size() && __sign == __neg_sign
-                 && __tmp_units[0] != __zero)
-               __tmp_units.insert(__tmp_units.begin(), __ctype.widen('-'));      
-             
-             // Test for grouping fidelity.
-             if (__grouping.size() && __grouping_tmp.size())
-               {
-                 if (!std::__verify_grouping(__grouping, __grouping_tmp))
-                   __testvalid = false;
-               }
-
-             // Iff not enough digits were supplied after the decimal-point.
-             if (__testdecfound)
-               {
-                 const int __frac = __intl ? __mpt.frac_digits() 
-                                           : __mpf.frac_digits();
-                 if (__frac > 0 && __sep_pos != __frac)
-                   __testvalid = false;
-               }
+             if (!std::__verify_grouping(__grouping, __grouping_tmp))
+               __testvalid = false;
+           }
+         
+         // Iff not enough digits were supplied after the decimal-point.
+         if (__testdecfound)
+           {
+             const int __frac = __intl ? __mpt.frac_digits() 
+                                       : __mpf.frac_digits();
+             if (__frac > 0 && __sep_pos != __frac)
+               __testvalid = false;
            }
-         else
-           __testvalid = false;
        }
+      else
+       __testvalid = false;
 
       // Iff no more characters are available.      
       if (__c == __eof)