diff --git a/src/cmd/ksh93/sh/xec.c b/src/cmd/ksh93/sh/xec.c index 5c673e828..c466f01b1 100644 --- a/src/cmd/ksh93/sh/xec.c +++ b/src/cmd/ksh93/sh/xec.c @@ -225,7 +225,7 @@ static void l_time(Sfio_t *outfile,register clock_t t,int precision) if(precision) { frac = t%sh.lim.clk_tck; - frac = (frac*100)/sh.lim.clk_tck; + frac = (frac*(int)pow(10,precision))/sh.lim.clk_tck; } t /= sh.lim.clk_tck; sec = t%60; diff --git a/src/cmd/ksh93/tests/builtins.sh b/src/cmd/ksh93/tests/builtins.sh index a2e0d92bf..8b61aef74 100755 --- a/src/cmd/ksh93/tests/builtins.sh +++ b/src/cmd/ksh93/tests/builtins.sh @@ -1516,5 +1516,10 @@ if builtin tail 2> /dev/null; then "(expected $(printf %q "$exp"), got $(printf %q "$got"))" fi +# ====== +# ksh93v- accidentally broke the sleep builtin's support for +# using microseconds in the form of U. +got=$(sleep 1U 2>&1) || err_exit "sleep builtin cannot handle microseconds in the form of U (got $(printf %q "$got"))" + # ====== exit $((Errors<125?Errors:125))