1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/sh
Johnothan King 307bc3edce time: Fix precision bug in times(3) fallback (#425)
In the times(3) fallback for the time keyword (which can be enabled
in xec.c by undefining _lib_getrusage and timeofday), ksh will
print the obtained time incorrectly if TIMEFORMAT is set to use a
precision level of three:
   $ TIMEFORMAT=$'\nreal\t%3lR'
   $ time sleep .080
   real 0m00.008s  # Should be '00.080s'
This commit corrects that issue by using 10^precision to get the
correct fractional scaling. Note that the fallback still doesn't
support a true precision level of three (times(3) alone doesn't
support it), so this in effect pads a zero to the end of the output
when the precision level is three.

Additional change to tests/builtins.sh:
- While fixing the above issue I found out that ksh93v- broke
  support for passing microseconds to the sleep builtin in the form
  of <num>U. I've added a regression test for that bug to ensure it
  isn't backported to ksh93u+m by accident.

Co-authored-by: Martijn Dekker <martijn@inlv.org>
2022-01-13 12:25:22 +00:00
..
args.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
arith.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
array.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
defs.c [shp cleanup 00] Reunify the original sh state struct 2022-01-01 02:28:06 +00:00
deparse.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
expand.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
fault.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
fcin.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
init.c edit: do not enable multiline mode with no editor active 2022-01-12 20:39:05 +00:00
io.c edit: do not enable multiline mode with no editor active 2022-01-12 20:39:05 +00:00
jobs.c Fix various typos, man page issues and improve the documentation (#415) 2022-01-07 16:17:55 +00:00
lex.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
macro.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
main.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
name.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
nvdisc.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
nvtree.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
nvtype.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
parse.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
path.c Fix various typos, man page issues and improve the documentation (#415) 2022-01-07 16:17:55 +00:00
pmain.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
shcomp.c edit: do not enable multiline mode with no editor active 2022-01-12 20:39:05 +00:00
streval.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
string.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
subshell.c Fix various typos, man page issues and improve the documentation (#415) 2022-01-07 16:17:55 +00:00
suid_exec.c Fix various typos, man page issues and improve the documentation (#415) 2022-01-07 16:17:55 +00:00
tdump.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
timers.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
trestore.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
waitevent.c [shp cleanup 01..20] all the rest (re: 2d3ec8b6) 2022-01-07 16:16:31 +00:00
xec.c time: Fix precision bug in times(3) fallback (#425) 2022-01-13 12:25:22 +00:00