Handle multiple timestamp formats, escape code
authorShane Synan <digitalcircuit36939@gmail.com>
Sun, 8 Jan 2017 22:53:06 +0000 (16:53 -0600)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 13 Apr 2017 19:56:06 +0000 (21:56 +0200)
commit41686743dca5b254a6f53a4a9e8f8b8d91acd041
treec62c2259d13c18cc2762bcf9ee1ec7babed269dc
parentdcd6c362d77ab4cb5ea73b7e54ce944a68aa3f06
Handle multiple timestamp formats, escape code

Move search and replace into a loop to handle multiple timestamp
format strings.  Include a limit on maximum number of iterations to
avoid any potential infinite loops (512 ought be enough for anybody).

Add check for empty %% group to allow using '%%%%' as '%%', two
literal percent signs.

Comments!  Document all the things.

Examples:
All Quassel clients vanished from the face of the earth... %%hh:mm:ss%%
> All Quassel clients vanished from the face of the earth... 23:20:34
Away since %%hh:mm%% on %%dd.MM%% - %%%% not here %%%%
> Away since 23:20 on 21.05 - %% not here %%
src/common/util.cpp
src/common/util.h