diff --git a/pkgs/racket-test-core/tests/racket/module.rktl b/pkgs/racket-test-core/tests/racket/module.rktl index 5e234b7a5f..7c2a792107 100644 --- a/pkgs/racket-test-core/tests/racket/module.rktl +++ b/pkgs/racket-test-core/tests/racket/module.rktl @@ -498,6 +498,13 @@ (test #t module-path? "x/./foo.rkt") (test #t module-path? "x/.") (test #t module-path? "x/..") +(test #f module-path? "@") +(test #f module-path? "\0") +(test #f module-path? "x@") +(test #f module-path? "x\0") +(test #f module-path? "@x") +(test #f module-path? "\0x") + (test #t module-path? (collection-file-path "module.rktl" "tests" "racket")) (test #t module-path? (string->path "x")) diff --git a/racket/src/expander/common/parse-module-path.rkt b/racket/src/expander/common/parse-module-path.rkt index fe9851071e..5c1a700803 100644 --- a/racket/src/expander/common/parse-module-path.rkt +++ b/racket/src/expander/common/parse-module-path.rkt @@ -128,7 +128,7 @@ [saw-slash? (not file-end-ok?)] [saw-dot? #f]) (cond - [(not (zero? i)) + [(not (negative? i)) ;; check next character (define c (string-ref v i)) (cond @@ -314,7 +314,7 @@ (define (test ok? v) (unless (equal? ok? (module-path? v)) (error 'module-path?-test "failed ~s; expected ~a" v ok?))) - + (test #t "hello") (test #t "hello.rkt") (test #f "hello*ss") @@ -342,6 +342,13 @@ (test #t "x/.") (test #t "x/..") + (test #f "@") + (test #f "\0") + (test #f "x@") + (test #f "x\0") + (test #f "@x") + (test #f "\0x") + (test #t (collection-file-path "module.rktl" "tests" "racket")) (test #t (string->path "x")) diff --git a/racket/src/racket/src/startup.inc b/racket/src/racket/src/startup.inc index a549e5acd7..6beff1ee03 100644 --- a/racket/src/racket/src/startup.inc +++ b/racket/src/racket/src/startup.inc @@ -3093,7 +3093,7 @@ static const char *startup_source = "(lambda(i_26 prev-was-slash?_0 saw-slash?_0 saw-dot?_0)" "(begin" " 'loop" -"(if(not(zero? i_26))" +"(if(not(negative? i_26))" "(let-values()" "(let-values(((c_6)(string-ref v_36 i_26)))" "(if(char=? c_6 '#\\/)"