Changeset 14621


Ignore:
Timestamp:
01/30/14 14:27:58 (10 years ago)
Author:
Mark Evenson
Message:

Untabify.

Location:
trunk/abcl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Pathname.java

    r14619 r14621  
    16421642                            File file = files[i];
    16431643                            Pathname p;
    1644               String path;
    1645               if (resolveSymlinks == NIL) {
    1646                 path = file.getAbsolutePath();
    1647               } else {
    1648                 path = file.getCanonicalPath();
    1649               }
    1650               URI pathURI = (new File(path)).toURI();
    1651               p = new Pathname(pathURI.toString());
     1644                            String path;
     1645                            if (resolveSymlinks == NIL) {
     1646                              path = file.getAbsolutePath();
     1647                            } else {
     1648                              path = file.getCanonicalPath();
     1649                            }
     1650                            URI pathURI = (new File(path)).toURI();
     1651                            p = new Pathname(pathURI.toString());
    16521652                            result = new Cons(p, result);
    16531653                        }
     
    20372037        }
    20382038        //  CLtLv2 MERGE-PATHNAMES
    2039  
    2040   // "[T]he missing components in the given pathname are filled
    2041   // in from the defaults pathname, except that if no version is
    2042   // specified the default version is used."
    2043 
    2044   // "The merging rules for the version are more complicated and
    2045   // depend on whether the pathname specifies a name. If the
    2046   // pathname doesn't specify a name, then the version, if not
    2047   // provided, will come from the defaults, just like the other
    2048   // components. However, if the pathname does specify a name,
    2049   // then the version is not affected by the defaults. The
    2050   // reason is that the version ``belongs to'' some other file
    2051   // name and is unlikely to have anything to do with the new
    2052   // one. Finally, if this process leaves the
    2053   // version missing, the default version is used."
     2039   
     2040    // "[T]he missing components in the given pathname are filled
     2041    // in from the defaults pathname, except that if no version is
     2042    // specified the default version is used."
     2043
     2044    // "The merging rules for the version are more complicated and
     2045    // depend on whether the pathname specifies a name. If the
     2046    // pathname doesn't specify a name, then the version, if not
     2047    // provided, will come from the defaults, just like the other
     2048    // components. However, if the pathname does specify a name,
     2049    // then the version is not affected by the defaults. The
     2050    // reason is that the version ``belongs to'' some other file
     2051    // name and is unlikely to have anything to do with the new
     2052    // one. Finally, if this process leaves the
     2053    // version missing, the default version is used."
    20542054
    20552055        if (p.version != NIL) {
     
    22032203            Cons jars = (Cons) pathname.device;
    22042204            LispObject o = jars.car();
    2205       if (!(o instanceof Pathname)) {
    2206          return doTruenameExit(pathname, errorIfDoesNotExist);
    2207       }
     2205        if (!(o instanceof Pathname)) {
     2206           return doTruenameExit(pathname, errorIfDoesNotExist);
     2207        }
    22082208            if (o instanceof Pathname
    22092209                && !(((Pathname)o).isURL())
     
    22832283        }
    22842284        error:
    2285     return doTruenameExit(pathname, errorIfDoesNotExist);
     2285      return doTruenameExit(pathname, errorIfDoesNotExist);
    22862286    }
    22872287   
  • trunk/abcl/src/org/armedbear/lisp/directory.lisp

    r14619 r14621  
    135135                      (matching-entries ()))
    136136                  (dolist (entry entries)
    137           (when
    138             (or
    139             (and
    140               (file-directory-p entry)
    141               (pathname-match-p (file-namestring (pathname-as-file entry))
    142                       (file-namestring pathname)))
    143             (pathname-match-p (or (file-namestring entry) "") (file-namestring pathname)))
    144             (push
    145              (if resolve-symlinks
    146                (truename entry)
    147                entry)
    148              matching-entries)))
     137                    (when
     138                        (or
     139                        (and
     140                          (file-directory-p entry)
     141                          (pathname-match-p (file-namestring (pathname-as-file entry))
     142                                            (file-namestring pathname)))
     143                        (pathname-match-p (or (file-namestring entry) "") (file-namestring pathname)))
     144                      (push
     145                       (if resolve-symlinks
     146                           (truename entry)
     147                           entry)
     148                       matching-entries)))
    149149                  matching-entries))))
    150150        ;; Not wild.
  • trunk/abcl/test/lisp/abcl/wild-pathnames.lisp

    r14620 r14621  
    1414    (let ((file (merge-pathnames file *temp-directory-root*)))
    1515      (ensure-directories-exist (directory-namestring file))
    16     (unless (probe-file file)
    17     (touch file)))))
     16      (unless (probe-file file)
     17        (touch file)))))
    1818
    1919(defun remove-wild-test-hierarchy ()
    2020  (ignore-errors
    21   (delete-directory-and-files *temp-directory-root*)))
     21    (delete-directory-and-files *temp-directory-root*)))
    2222
    2323(defmacro with-test-directories (&rest body)
     
    3333   
    3434(deftest wild-pathnames.1
    35   (with-test-directories
    36     (let ((results
    37          (directory (merge-pathnames "**/*.ext"
    38                        *temp-directory-root*)))
    39         (expected
    40          (loop :for file :in *test-files*
    41           :collecting (merge-pathnames file
    42                          *temp-directory-root*))))
    43     (values
    44      (eq (length results) (length expected))
    45     ;; link --> file is not resolved by change in DIRECTORY to :RESOLVE-SYMLINKS nil
    46      results
    47      expected
    48      (set-equal (mapcar #'truename results)
    49           (mapcar #'truename expected)))))
     35    (with-test-directories
     36        (let ((results
     37               (directory (merge-pathnames "**/*.ext"
     38                                           *temp-directory-root*)))
     39              (expected
     40               (loop :for file :in *test-files*
     41                  :collecting (merge-pathnames file
     42                                               *temp-directory-root*))))
     43      (values
     44       (eq (length results) (length expected))
     45      ;; link --> file is not resolved by change in DIRECTORY to :RESOLVE-SYMLINKS nil
     46       results
     47       expected
     48       (set-equal (mapcar #'truename results)
     49                  (mapcar #'truename expected)))))
    5050  t)
    5151
     
    5959  t)
    6060
    61  
     61   
    6262
Note: See TracChangeset for help on using the changeset viewer.