/[cmucl]/src/code/filesys.lisp
ViewVC logotype

Diff of /src/code/filesys.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by wlott, Sat Feb 15 12:47:35 1992 UTC revision 1.28 by phg, Wed Aug 19 18:45:34 1992 UTC
# Line 205  Line 205 
205                     nil                     nil
206                     version)))))                     version)))))
207    
208  (defun split-at-slashes (namestr start end)  (defun split-at-slashes (namestr start end &optional (char #\/))
209    (declare (type simple-base-string namestr)    "Take a string and return a list of cons cells that mark the char
210       separated subseq. The first value t if absolute directories location."
211        (declare (type simple-base-string namestr)
212             (type index start end))             (type index start end))
213    (let ((absolute (and (/= start end)    (let ((absolute (and (/= start end)
214                         (char= (schar namestr start) #\/))))                         (char= (schar namestr start) char))))
215      (when absolute      (when absolute
216        (incf start))        (incf start))
217      ;; Next, split the remainder into slash seperated chunks.      ;; Next, split the remainder into ; separated chunks.
218      (collect ((pieces))      (collect ((pieces))
219        (loop        (loop
220          (let ((slash (position #\/ namestr :start start :end end)))          (let ((char-pos (position char namestr :start start :end end)))
221            (pieces (cons start (or slash end)))            (pieces (cons start (or char-pos end)))
222            (unless slash            (unless char-pos
223              (return))              (return))
224            (setf start (1+ slash))))            (setf start (1+ char-pos))))
225        (values absolute (pieces)))))        (values absolute (pieces)))))
226    
227  (defun maybe-extract-search-list (namestr start end)  (defun maybe-extract-search-list (namestr start end)
# Line 298  Line 300 
300    
301  (defun unparse-unix-piece (thing)  (defun unparse-unix-piece (thing)
302    (etypecase thing    (etypecase thing
303        (keyword
304         (cond ((eq thing ':wild) "*")
305               ((eq thing ':wild-inferiors) "**")
306               (t (error "Invalid keyword piece: ~S~%" thing))))
307      (simple-string      (simple-string
308       (let* ((srclen (length thing))       (let* ((srclen (length thing))
309              (dstlen srclen))              (dstlen srclen))
# Line 324  Line 330 
330              (strings piece))              (strings piece))
331             (symbol             (symbol
332              (case piece              (case piece
333                  (:wild
334                   (strings "*"))
335                (:multi-char-wild                (:multi-char-wild
336                 (strings "*"))                 (strings "*"))
337                (:single-char-wild                (:single-char-wild

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.5