X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FFormat.cpp;h=feec8fb255c3f9b4c15807e22f43e9433aad56d8;hb=0b326f2ebc27293c6dcfab91fd5d991c4cd4ea03;hp=553c550abd46d5c56449dedeec6d757db4a27867;hpb=e1a2cdefda74db3039afc03e9579e7cf56b910cd;p=folly.git diff --git a/folly/Format.cpp b/folly/Format.cpp index 553c550a..feec8fb2 100644 --- a/folly/Format.cpp +++ b/folly/Format.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "folly/Format.h" +#include namespace folly { namespace detail { @@ -96,7 +96,15 @@ void FormatArg::initSlow() { while (p != end && *p >= '0' && *p <= '9') { ++p; } - precision = to(StringPiece(b, p)); + if (p != b) { + precision = to(StringPiece(b, p)); + if (p != end && *p == '.') { + trailingDot = true; + ++p; + } + } else { + trailingDot = true; + } if (p == end) return; }