improve system-relative-pathname
Gary King <[email protected]> Sun, 15 Jun 2008 12:10:50 -0400
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
When I wrote system-relative-pathname I did a bad-thing (tm) when I altered the return value of pathname-directory. The CL spec. doesn't say whether or not the return values of the pathname-X functions share structure with the pathname so it isn't wise to assume that they don't. The code below fixes this by consing up a fresh list. > (defun system-relative-pathname (system pathname &key name type) > - (let ((directory (pathname-directory pathname))) > + ;; you're not allowed to muck with the return value of pathname-X > + (let ((directory (copy-list (pathname-directory pathname)))) > (when (eq (car directory) :absolute) > (setf (car directory) :relative)) > (merge-pathnames > If I don't hear back from the internets, I'll commit this sometime this week. -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php