Fix a few minor StringFormatter issues

* Recognize the end of a format specifier properly
* Make '$' actually work
develop
lethosor 2015-01-09 20:02:44 -05:00
parent 5a92080cc1
commit c36daa4d7d
1 changed files with 3 additions and 1 deletions

@ -439,6 +439,7 @@ public:
}
if (!candidates.size())
return "";
// Select the longest candidate
std::sort(candidates.begin(), candidates.end(), StringFormatter<T>::compare_opts);
return candidates[0];
}
@ -476,7 +477,8 @@ public:
if (func != NULL)
dest += func(obj);
i += opt.size();
if (i < opt.size() && opt[i] == '$')
in_opt = false;
if (i < fmt.size() && fmt[i] == '$')
// Allow $ to terminate format options
i++;
}