From 3f178f99d089e7d0f6f0542aee6173ef75adec95 Mon Sep 17 00:00:00 2001 From: sperber Date: Sat, 9 Jun 2001 09:28:51 +0000 Subject: [PATCH] Display relative filenames in directory listings. --- ftpd.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ftpd.scm b/ftpd.scm index ece46e2..86e4836 100644 --- a/ftpd.scm +++ b/ftpd.scm @@ -542,8 +542,17 @@ path (car packet)))) (lambda () - (ls flags (list full-path) (socket:outport - (session-data-socket))))))) + (with-cwd* + (file-name-directory full-path) + (lambda () + (let ((nondir (file-name-nondirectory full-path))) + (ls flags + (list + ;; work around OLIN BUG + (if (string=? nondir "") + "." + (file-name-as-directory nondir))) + (socket:outport (session-data-socket)))))))))) (define (handle-abor foo) (maybe-close-data-connection) @@ -772,7 +781,7 @@ ; Version -(define *ftpd-version* "$Revision: 1.3 $") +(define *ftpd-version* "$Revision: 1.4 $") (define (copy-port->port-binary input-port output-port) (let ((buffer (make-string *window-size*)))