chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] make-pathname returning more 'canonical' paths


From: felix winkelmann
Subject: Re: [Chicken-users] make-pathname returning more 'canonical' paths
Date: Sun, 11 Jun 2006 23:53:36 +0200

On 6/10/06, Alejandro Forero Cuervo <address@hidden> wrote:

One of my programs kinda relies on make-pathname returning "canonical"
paths.  I noticed that, on Chicken 2.3,

  (make-pathname "" "foo")

returns "/foo" instead of "foo", which was what I was expecting.  I
wasn't expecting (cut make-pathname "" <>) to return an absolute path.
That has forced me to add that check and write

  (make-pathname (and (not (string=? dir "")) dir) file)

instead of (make-pathname dir file).  Similarly,

  (make-pathname '("foo" "" "bar") "yes")

returns "foo//bar/yes" (notice the consecutive slashes).  Attached is
an untested patch (against 2.3) that changes this behaviour, only
appending a slash when it is really needed.

I think this bug has already been fixed in the current development
version (IIRC by Kon, but I forgot).


(felix)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]