Ignore:
Timestamp:
Mar 29, 2009, 5:41:14 PM (12 years ago)
Author:
gb
Message:

Functions that parse namestrings have called GET-SSTRING on their
string arguments so that they're sure that they're operating on a
bounded SIMPLE-STRING. Those parsing functions (hopefully all of
them) now call GET-PATHNAME-SSTRING instead. On non-Windows platforms,
this just calls GET-SSTRING and returns its results; on Windows, it
checks to see if the bounded simple-string contains backslashes and
if so, it returns a copy with the backslashes replaced with forward-slashes.

This is one way to allow pathname functions to handle Windows pathnames
that use #
as a directory separator. (The other way would be to
change a lot of ancient namestring-parsing code to handle either #
or #\/ as a directory separator, and this approach is certainly simpler.)
The extra consing should only happen if user code does something like:

(let* ((home-string (getenv "HOME")))

(if home-string

(pathname-name home-string)))

System code that deals with namestrings returned by the OS can generally
destructively change any backslashes in that namestring to forward slashes
before passing the string to pathname-parsing functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-pathnames.lisp

    r11639 r11859  
    361361
    362362(defun logical-pathname-namestring-p (string)
    363   (multiple-value-bind (sstr start end) (get-sstring string)
     363  (multiple-value-bind (sstr start end) (get-pathname-sstring string)
    364364    (let ((host (pathname-host-sstr sstr start end t)))
    365365      (and host (not (eq host :unspecific))))))
Note: See TracChangeset for help on using the changeset viewer.