(let* ((selector-list (string-split raw-selector "\t"))
(selector (car selector-list))
(arguments (cdr selector-list)))
(case (infer-selector-type selector)
((1) (serve-directory selector config))
((0) (serve-text-file selector config))
(let* ((selector-list (string-split raw-selector "\t"))
(selector (car selector-list))
(arguments (cdr selector-list)))
(case (infer-selector-type selector)
((1) (serve-directory selector config))
((0) (serve-text-file selector config))
(let ((file-name (make-pathname (config-root-dir config) selector)))
(if (and (regular-file? file-name)
(= (length arguments) 1))
(let ((file-name (make-pathname (config-root-dir config) selector)))
(if (and (regular-file? file-name)
(= (length arguments) 1))
(('shell command) (serve-shell-command command dir-selector config))
(('eval expression) (serve-expression expression dir-selector config))
(('url display-string url)
(('shell command) (serve-shell-command command dir-selector config))
(('eval expression) (serve-expression expression dir-selector config))
(('url display-string url)
((type display-string selector host port)
(print type display-string "\t" selector "\t" host "\t" port "\r"))
((type display-string selector host)
((type display-string selector host port)
(print type display-string "\t" selector "\t" host "\t" port "\r"))
((type display-string selector host)
- (serve-info-records (string-chomp (read-string #f in-port) "\n"))))))
+ (let ((string (read-string #f in-port)))
+ (if (and (not (eof-object? string))
+ (> (string-length string) 0))
+ (serve-info-records (string-chomp string "\n"))))))))