improved fix to PR 8880

svn: r7126
This commit is contained in:
Robby Findler 2007-08-20 08:51:17 +00:00
parent 1135ca5140
commit c1838f88e0

View File

@ -93,8 +93,16 @@
(cond (cond
[(and (list? html-doc-paths) [(and (list? html-doc-paths)
(andmap path-string? html-doc-paths)) (andmap path-string? html-doc-paths))
(append (map (lambda (x) (build-path dir x)) html-doc-paths) (let ([candidates (map (lambda (x) (build-path dir x)) html-doc-paths)])
(loop (cdr dirs)))] (for-each (λ (c)
(unless (directory-exists? c)
(fprintf (current-error-port)
"found reference to ~a in html-docs for ~a, but it is not a directory\n"
(path->string c)
(path->string dir))))
candidates)
(append (filter directory-exists? candidates)
(loop (cdr dirs))))]
[else [else
(loop (cdr dirs))]))] (loop (cdr dirs))]))]
[else (loop (cdr dirs))]))])))) [else (loop (cdr dirs))]))]))))
@ -361,13 +369,11 @@
;; tex2page-detected : string -> (union #f string) ;; tex2page-detected : string -> (union #f string)
(define (tex2page-detected dir) (define (tex2page-detected dir)
(and (directory-exists? dir)
(let loop ([contents (directory-list dir)]) (let loop ([contents (directory-list dir)])
(cond (cond
[(null? contents) #f] [(null? contents) #f]
[else (let* ([file (car contents)] [else (let* ([file (car contents)]
[m (regexp-match #rx#"(.*)-Z-H-1.html" [m (regexp-match #rx#"(.*)-Z-H-1.html" (path->bytes file))])
(path->bytes file))])
(or (and m (or (and m
(file-exists? (build-path dir file)) (file-exists? (build-path dir file))
(let ([index-file (let ([index-file
@ -376,7 +382,7 @@
(if (file-exists? (build-path dir index-file)) (if (file-exists? (build-path dir index-file))
index-file index-file
#f))) #f)))
(loop (cdr contents))))])))) (loop (cdr contents))))])))
(provide main-manual-page) (provide main-manual-page)