X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FFormat.cpp;h=feec8fb255c3f9b4c15807e22f43e9433aad56d8;hb=0b326f2ebc27293c6dcfab91fd5d991c4cd4ea03;hp=460f74894777dc71c1751af7c0b600c11edfe3e4;hpb=27494a20393fa45072e7d526d358835f3abe312a;p=folly.git diff --git a/folly/Format.cpp b/folly/Format.cpp index 460f7489..feec8fb2 100644 --- a/folly/Format.cpp +++ b/folly/Format.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012 Facebook, Inc. + * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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; }