fix bug in exe creation where 'lib runtime-paths could be mis-parsed as mzlib paths

svn: r11966
This commit is contained in:
Matthew Flatt 2008-10-07 16:00:36 +00:00
parent bda26f5eaa
commit 89f2315374
4 changed files with 110 additions and 81 deletions

View File

@ -820,10 +820,18 @@
(get-lib-search-dirs)))] (get-lib-search-dirs)))]
[(and (list? p) [(and (list? p)
(eq? 'lib (car p))) (eq? 'lib (car p)))
(let ([p (if (and (null? (cddr p))
(regexp-match #rx"^[^/]*[.]" (cadr p)))
p
(let ([s (regexp-split #rx"/" (cadr p))])
(if (null? (cdr s))
`(lib ,(cadr p) "main.ss")
(let ([s (reverse s)])
`(list ,(car s) ,@(reverse (cdr s)))))))])
(build-path (if (null? (cddr p)) (build-path (if (null? (cddr p))
(collection-path "mzlib") (collection-path "mzlib")
(apply collection-path (cddr p))) (apply collection-path (cddr p)))
(cadr p))] (cadr p)))]
[else p])]) [else p])])
(and p (and p
(path->bytes (path->bytes

View File

@ -0,0 +1,9 @@
#lang scheme/base
(require scheme/runtime-path
(for-syntax scheme/base))
(define-runtime-path file '(lib "icons/file.gif"))
(with-output-to-file "stdout"
(lambda () (printf "This is 1b~n"))
#:exists 'append)

View File

@ -0,0 +1,9 @@
#lang scheme/base
(require scheme/runtime-path
(for-syntax scheme/base))
(define-runtime-path file '(lib "etc.ss")) ; in mzlib
(with-output-to-file "stdout"
(lambda () (printf "This is 1c~n"))
#:exists 'append)

View File

@ -98,7 +98,7 @@
(define dest (if mred? mr-dest mz-dest)) (define dest (if mred? mr-dest mz-dest))
(define (flags s) (define (flags s)
(string-append "-" s)) (string-append "-" s))
(define (one-mz-test filename expect) (define (one-mz-test filename expect literal?)
;; Try simple mode: one module, launched from cmd line: ;; Try simple mode: one module, launched from cmd line:
(prepare dest filename) (prepare dest filename)
(make-embedding-executable (make-embedding-executable
@ -129,6 +129,7 @@
(w/prefix #f) (w/prefix #f)
(w/prefix 'before:)) (w/prefix 'before:))
(when literal?
;; Try full path, and use literal S-exp to start ;; Try full path, and use literal S-exp to start
(printf ">>>literal sexp\n") (printf ">>>literal sexp\n")
(prepare dest filename) (prepare dest filename)
@ -207,10 +208,12 @@
"This is the literal expression 4.\n" "This is the literal expression 4.\n"
"... and more!\n" "... and more!\n"
expect) expect)
mred?)) mred?)))
(one-mz-test "embed-me1.ss" "This is 1\n") (one-mz-test "embed-me1.ss" "This is 1\n" #t)
(one-mz-test "embed-me2.ss" "This is 1\nThis is 2: #t\n") (one-mz-test "embed-me1b.ss" "This is 1b\n" #f)
(one-mz-test "embed-me1c.ss" "This is 1c\n" #f)
(one-mz-test "embed-me2.ss" "This is 1\nThis is 2: #t\n" #t)
;; Try unicode expr and cmdline: ;; Try unicode expr and cmdline:
(prepare dest "unicode") (prepare dest "unicode")