[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] make-pathname returning more 'canonical' paths
From: |
Alejandro Forero Cuervo |
Subject: |
[Chicken-users] make-pathname returning more 'canonical' paths |
Date: |
Sat, 10 Jun 2006 12:50:11 -0500 |
User-agent: |
Mutt/1.5.9i |
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.
Alejo.
http://azul.freaks-unidos.net/
patch-make-pathname
Description: Text document
- [Chicken-users] make-pathname returning more 'canonical' paths,
Alejandro Forero Cuervo <=