it's ignored if it would cause syntax error, otherwise treated as common
string; this is so that both 'expr -- : .' and 'expr -- foo : .' works
This addresses standards/11230 by Ben Harris.
while here, make all global variables but main() static, use const more
from old expr.c. This fixes PR # 11060.
While here, convert the code to use asprintf() instead of strdup()
followed by truncating of new string and move definition of errstr
to block where it's used.
highlights:
* / is treated correctly depending upon context (addresses PR # 10995)
* use 64 bit arithmetic, so expr is able to process integer values from
-(2**63) to (2**63 - 1)
* checks for integer over- & underflows added
* error messages improved, more error checking added
add AUTHOR section to manpage
add BUGS section, and mention possible drawbacks with other expr implementations
XXX the old expr treated empty string in arithmetic expressions as if it was 0
XXX this behaviour has been retained