This makes 'jot - 9 - -.5' generate 9 9 8 8 etc again.
When printing random numbers generate a sane range when ender < begin.
For random integers we must use random()/2^31 since we don't want the
value above generated should random() return 2^31-1.
set the defaults at compile time and calculate any derived values in
a simple switch statement.
Use names for the bit-patterns that indicate that fields are present.
Seems to behave the same way as the earlier version.
range by 1 so that the quoted upper and lower values both appear, and
with the same frequency as the intermediate values.
This reverts the change from rev 1.13, and fixes it properly!
Also fixes 'jot -r -c - 97 98' as reported to netbsd-bugs (but not as a PR!).
bin/12316 more completely.
Highlights:
* we only allow explicitly specified set of (numberic) formats
* %% is correctly skipped, extra %foo formats are detected
* '*' in format specification is not allowed
The code in getformat() is slighly different to the OpenBSD version
of fix - the list of allowed printf(3) flags is explicit and the
condition checking 'chardata' is written slighly differently.
Also pull-in some cosmetic changes from OpenBSD - s/isdefault()/is_default()/,
error() -> errx(), usage().