diff options
-rw-r--r-- | index.scml | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -18,9 +18,9 @@ ;;;; (define ellinika-document-root "/home/gray/public_html/ellinika") -(define ellinika-default-language "ru") +(define ellinika-dispatcher "disp.html") -(define (get-dir-name) +(define (get-file-name) (call-with-current-continuation (lambda (return) (for-each @@ -29,12 +29,8 @@ (suff (list #\. #\_))) (let ((dir (string-append ellinika-document-root "/" slang))) (cond - ((catch 'system-error - (lambda () - (eq? (stat:type (stat dir)) 'directory)) - (lambda args - #f)) - (return dir)) + ((access? (string-append dir "/index.html") R_OK) + (return (string-append dir "/index.html"))) ((not (null? suff)) (let ((p (let itr ((sl suff)) (if (null? sl) @@ -57,10 +53,10 @@ (string-split (table:get (request-rec:subprocess-env Request) "HTTP_ACCEPT_LANGUAGE") #\,))) - (string-append ellinika-document-root "/" ellinika-default-language)))) + (string-append ellinika-document-root "/" ellinika-dispatcher)))) (with-input-from-file - (string-append (get-dir-name) "/intro.html") + (get-file-name) (lambda () (do ((line (read-line) (read-line))) ((eof-object? line)) |