Fixes a bug in `make-temporary-file'

When (current-milliseconds) was negative, the string substituted into
the template would contain non-digits, violating the promise in the
documentation.
This commit is contained in:
Casey Klein 2010-12-08 15:20:27 -06:00
parent e65598c98c
commit d55cdb7785

View File

@ -85,7 +85,8 @@
"path, valid-path, string, or #f"
base-dir))
(let ([tmpdir (find-system-path 'temp-dir)])
(let loop ([s (current-seconds)][ms (current-milliseconds)])
(let loop ([s (current-seconds)]
[ms (inexact->exact (truncate (current-inexact-milliseconds)))])
(let ([name (let ([n (format template (format "~a~a" s ms))])
(cond [base-dir (build-path base-dir n)]
[(relative-path? n) (build-path tmpdir n)]