mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 04:34:26 +02:00
Allow only one decimal point to be read under "%Ez".
This commit is contained in:
7
tz.h
7
tz.h
@@ -1600,17 +1600,18 @@ parse(std::basic_istream<CharT, Traits>& is,
|
|||||||
}
|
}
|
||||||
if (ratio_less<typename Duration::period, ratio<1>>::value)
|
if (ratio_less<typename Duration::period, ratio<1>>::value)
|
||||||
{
|
{
|
||||||
CharT decimal_point =
|
auto decimal_point = Traits::to_int_type(
|
||||||
use_facet<numpunct<CharT>>(is.getloc()).decimal_point();
|
use_facet<numpunct<CharT>>(is.getloc()).decimal_point());
|
||||||
string buf;
|
string buf;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
auto k = is.peek();
|
auto k = is.peek();
|
||||||
if (Traits::eq_int_type(k, Traits::eof()))
|
if (Traits::eq_int_type(k, Traits::eof()))
|
||||||
break;
|
break;
|
||||||
if (k == decimal_point)
|
if (Traits::eq_int_type(k, decimal_point))
|
||||||
{
|
{
|
||||||
buf += '.';
|
buf += '.';
|
||||||
|
decimal_point = Traits::eof();
|
||||||
is.get();
|
is.get();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user