X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scratchy.git;a=blobdiff_plain;f=scratchy.scm;h=5e6a37f62fb927f0325a53e84642a1ebc408a30d;hp=cd4fa8eb891ab8838418e7d3184b9a5242cbf087;hb=c2c6656ac9d361bc7cb983e8f6c23abd8f8ee73b;hpb=03b5e62d691ad9bcd89fb76e5b164a36cce9f17c diff --git a/scratchy.scm b/scratchy.scm index cd4fa8e..5e6a37f 100644 --- a/scratchy.scm +++ b/scratchy.scm @@ -20,7 +20,7 @@ ;;; Global constants -(define scratchy-version "1.3.0") +(define scratchy-version "1.4.1") (define scratchy-footer (conc "\n" @@ -76,8 +76,8 @@ (serve-selector selector config))) (print "... served selector '" selector "'. Closing connection.")) (o (exn) - (print-error-message o out-port) (print-error-message o) + (display "Invalid selector.\r\n.\r\n" out-port) (print "Error while attempting to serve selector " selector ".")))) (begin (print "Connection from blacklisted IP. Closing.") @@ -234,7 +234,7 @@ (if (legal-script-filename? filename config) (let* ((sexp (with-input-from-file filename read)) (script-result (with-selector-dir - selector config + (pathname-directory selector) config (lambda () (apply (eval sexp) arguments))))) (when (pair? script-result) @@ -280,7 +280,7 @@ dir-selector config)) ((type display-string selector) (serve-record (list type display-string - (make-pathname dir-selector selector) + (normalize-pathname (make-pathname dir-selector selector)) (config-host config) (config-port config)) dir-selector config)) ((display-string selector) @@ -350,9 +350,9 @@ (define (main) (let* ((progname (pathname-file (car (argv)))) (config (make-config '() '() 70 #t '() '() '() '()))) - (if (null? (cdr (argv))) + (if (null? (command-line-arguments)) (print-usage progname) - (let loop ((args (cdr (argv)))) + (let loop ((args (command-line-arguments))) (let ((this-arg (car args)) (rest-args (cdr args))) (if (string-prefix? "-" this-arg)