fix a parameter check

This commit is contained in:
Matthew Flatt 2013-04-26 07:09:24 -06:00
parent e8f8217070
commit 400e461d75
2 changed files with 17 additions and 7 deletions

View File

@ -528,4 +528,13 @@
(when (file-exists? temp-compiled-file) (delete-file temp-compiled-file))
(err/rt-test (read-on-demand-source 5))
(err/rt-test (read-on-demand-source "x"))
(test (find-system-path 'temp-dir) 'rods (parameterize ([read-on-demand-source (find-system-path 'temp-dir)])
(read-on-demand-source)))
(test #f 'rods (parameterize ([read-on-demand-source #f])
(read-on-demand-source)))
;; ----------------------------------------
(report-errs)

View File

@ -799,11 +799,12 @@ static Scheme_Object *rdl_check(int argc, Scheme_Object **argv)
{
Scheme_Object *s = argv[0];
return (SCHEME_FALSEP(s)
|| (SCHEME_PATHP(s)
&& scheme_is_complete_path(SCHEME_PATH_VAL(s),
SCHEME_PATH_LEN(s),
SCHEME_PLATFORM_PATH_KIND)));
return ((SCHEME_FALSEP(s)
|| (SCHEME_PATHP(s)
&& scheme_is_complete_path(SCHEME_PATH_VAL(s),
SCHEME_PATH_LEN(s),
SCHEME_PLATFORM_PATH_KIND)))
? scheme_true : scheme_false);
}
static Scheme_Object *
@ -813,8 +814,8 @@ read_delay_load(int argc, Scheme_Object *argv[])
scheme_make_integer(MZCONFIG_DELAY_LOAD_INFO),
argc, argv,
-1, rdl_check,
"(or/c #f (and/c path-string? complete-path?))",
1);
"(or/c #f (and/c path? complete-path?))",
0);
}
#endif