Changeset 11639 for trunk/source/level-1


Ignore:
Timestamp:
Jan 22, 2009, 12:17:53 AM (11 years ago)
Author:
gb
Message:

Define *CASE-SENSITIVE-FILESYSTEM*, default it to T.
Usee it to determine whether EQUAL and CCL::PATH-STR-MATCH-P (at least) do
case-sensitive comparisons of pathname components.
Of course, whehter or not a filesystem is case-sensitive is an attribute
of the filesystem and not of the value of a lisp variable; this variable
really controls nothing more than whether or not the implementation assumes
that the filesystems it encounters are case-sensitive or not, and therefore
whether or not comparisons of pathname components should fold case or not.

This is a hack, which might disappear if a better way of solving the problem
it's trying to solve becomes apparent.

File:
1 edited

Legend:

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

    r10942 r11639  
    581581                (return)))))))))
    582582
     583
    583584(defun path-str-match-p (pattern str p-start s-start p-end s-end)
    584585  (declare (fixnum p-start s-start p-end s-end)
     
    593594        (return nil))
    594595      (let ((p (%scharcode pattern p-start)))
     596        (unless *case-sensitive-filesystem*
     597          (setq p (%char-code-upcase p)))
    595598        (when (eq p esc)
    596599          (when (eq (setq p-start (1+ p-start)) p-end)
    597600            (return nil))
    598           (setq p (%scharcode pattern p-start)))
    599         (unless (eq p (%scharcode str s-start))
    600           (return nil))
     601          (setq p (%scharcode pattern p-start))
     602          (unless *case-sensitive-filesystem*
     603            (setq p (%char-code-upcase p))))
     604        (let* ((q (%scharcode str s-start)))
     605          (unless *case-sensitive-filesystem*
     606            (setq q (%char-code-upcase q)))
     607          (unless (eq p q)
     608            (return nil)))
    601609        (setq p-start (1+ p-start))
    602610        (setq s-start (1+ s-start))))))
Note: See TracChangeset for help on using the changeset viewer.