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:
parent
e65598c98c
commit
d55cdb7785
|
@ -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)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user