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,22 +369,20 @@
;; 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" (path->bytes file))])
[m (regexp-match #rx#"(.*)-Z-H-1.html" (or (and m
(path->bytes file))]) (file-exists? (build-path dir file))
(or (and m (let ([index-file
(file-exists? (build-path dir file)) (bytes->path
(let ([index-file (bytes-append (cadr m) #".html"))])
(bytes->path (if (file-exists? (build-path dir index-file))
(bytes-append (cadr m) #".html"))]) index-file
(if (file-exists? (build-path dir index-file)) #f)))
index-file (loop (cdr contents))))])))
#f)))
(loop (cdr contents))))]))))
(provide main-manual-page) (provide main-manual-page)