scsh-hackers
[Top] [All Lists]

[Scsh-hackers] [ scsh-Bugs-885631 ] resolve-file-name removes trailing /

To: noreply@sourceforge.net
Subject: [Scsh-hackers] [ scsh-Bugs-885631 ] resolve-file-name removes trailing /
From: "SourceForge.net" <noreply@sourceforge.net>
Date: Tue Jan 27 09:25:27 2004
List-id: Discussion among the implementors <scsh-hackers.lists.sourceforge.net>
Sender: scsh-hackers-admin@lists.sourceforge.net
Bugs item #885631, was opened at 2004-01-27 17:45
Message generated for change (Comment added) made by mainzelm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110493&aid=885631&group_id=10493

Category: run-time
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Schoinobates Volans (schoinobates)
Assigned to: Nobody/Anonymous (nobody)
Summary: resolve-file-name removes trailing /

Initial Comment:
resolve-file-name removes a trailing slash, if present, but this is not 
documented.

I think that it is the wrong behaviour anyway, i.e. that it shouldn't remove 
trailing slashes.

This, in turn, creates bugs in functions that use resolve-file-name but put 
some semantics in a trailing slash, like for example the library path stuff: A 
trailing slash in SCSH_LIB_DIRS gets ignored, instead of enabling recursive 
search. If you decide to keep the current resolve-file-name behaviour, please 
fix these places. You'll probably want to give users a function that does 
~-expansion / relative-to-absolute conversion without removing trailing 
slashes, too.


--- scsh-0.6.5.orig/scsh/fname.scm
+++ scsh-0.6.5/scsh/fname.scm
@@ -169,8 +169,7 @@
        fname)))
 
 (define (resolve-file-name fname . maybe-root)
-  (let* ((root (ensure-file-name-is-nondirectory (:optional maybe-root ".")))
-        (fname (ensure-file-name-is-nondirectory fname)))
+  (let* ((root (:optional maybe-root ".")))
     (if (zero? (string-length fname))
        "/"
        (let ((c (string-ref fname 0)))


----------------------------------------------------------------------

>Comment By: Martin Gasbichler (mainzelm)
Date: 2004-01-27 18:15

Message:
Logged In: YES 
user_id=17553

RESOLVE-FILE-NAME works on file names which do not have trailing 
slashes, see Section 5.1.1 of the manual. So I think the implementation is 
at least what Olin Shivers had in mind. However, I agree that the behaviour 
is not very intuitive and I ran into this problem by myself as you can see in 
the library search code. However, I fixed this a couple of weeks ago in 
CVS.

--
Martin


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110493&aid=885631&group_id=10493


<Prev in Thread] Current Thread [Next in Thread>