mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 02:22:57 +01:00
Allow absolute index to be used when all values has been used.
This commit is contained in:
parent
5cd3e842e8
commit
2cdfa7ae57
@ -350,7 +350,7 @@ void format(std::string& result, const std::string& fmt, const std::vector<Any>&
|
||||
{
|
||||
case '%':
|
||||
++itFmt;
|
||||
if (itFmt != endFmt && itVal != endVal)
|
||||
if (itFmt != endFmt && (itVal != endVal || *itFmt == '['))
|
||||
{
|
||||
if (*itFmt == '[')
|
||||
{
|
||||
|
@ -349,6 +349,9 @@ void FormatTest::testIndex()
|
||||
|
||||
s = format("%%%[1]d%%%[2]d%%%d", 1, 2, 3);
|
||||
assert(s == "%2%3%1");
|
||||
|
||||
s = format("%%%d%%%d%%%[0]d", 1, 2);
|
||||
assert(s == "%1%2%1");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user