stop ~ in format modifying format string
authorDavid Mitchell <davem@iabyn.com>
Thu, 26 May 2011 07:57:07 +0000 (08:57 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sun, 29 May 2011 19:21:52 +0000 (20:21 +0100)
commitb57b17349edad3eb77b8bbcdf1aee88b481e183f
treed1f78054acb0276d7b54387ff81973d4b74a09cf
parent086b26f34368613caec44287505d3c6f0a6336a7
stop ~ in format modifying format string

Currently, the format parser converts ~ or ~~ in a format string into
blank spaces. Since the previous-but-one commit, it only does it in a copy
rather than the original string, but this still defeats the "if the string
is the same don't recompile" mechanism.

Fix this by leaving the ~ alone in the format string, but instead cause
FF_LITERAL to convert '~' to ' ' when appending to the target.

Also, in S_doparseform(), improve the processing of '~~': previously
it only skipped one '~', and processed the second '~' on the next loop;
this happened to work, but it's less unexpected to process both chars at
once.

I've also added some tests, but these don't actually test whether the
format gets re-compiled: I couldn't think of a way to do that short of
checking the output of perl -Df. Instead the tests I added were based
around making sure I didn't break anything related to ~~ formatting.

I also improved the description string for some of the existing tests.
pp_ctl.c
t/op/write.t