/[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.81 by rtoy, Wed Jun 2 14:46:08 2004 UTC revision 1.82 by rtoy, Mon Sep 13 17:42:40 2004 UTC
# Line 177  Line 177 
177             (type index start end))             (type index start end))
178    (labels    (labels
179        ((explicit-version (namestr start end)        ((explicit-version (namestr start end)
180           (cond ((or (< (- end start) 5)           ;; Look for something like "~*~" at the end of the
181             ;; namestring, where * can be #\* or some digits.  This
182             ;; denotes a version.
183             (cond ((or (< (- end start) 4)
184                      (char/= (schar namestr (1- end)) #\~))                      (char/= (schar namestr (1- end)) #\~))
185                  ;; No explicit version given, so return NIL to                  ;; No explicit version given, so return NIL to
186                  ;; indicate we don't want file versions, unless                  ;; indicate we don't want file versions, unless
# Line 186  Line 189 
189                 ((and (char= (schar namestr (- end 2)) #\*)                 ((and (char= (schar namestr (- end 2)) #\*)
190                       (char= (schar namestr (- end 3)) #\~)                       (char= (schar namestr (- end 3)) #\~)
191                       (char= (schar namestr (- end 4)) #\.))                       (char= (schar namestr (- end 4)) #\.))
192                    ;; Found "~*~", so it's a wild version
193                  (values :wild (- end 4)))                  (values :wild (- end 4)))
194                 (t                 (t
195                    ;; Look for a version number.  Start at the end, just
196                    ;; before the ~ and keep looking for digits.  If the
197                    ;; first non-digit is ~, we have a version number, so
198                    ;; get it.  If not, we didn't find a version number,
199                    ;; so we call it :newest
200                  (do ((i (- end 2) (1- i)))                  (do ((i (- end 2) (1- i)))
201                      ((< i (+ start 2)) (values :newest end))                      ((< i (+ start 1)) (values :newest end))
202                    (let ((char (schar namestr i)))                    (let ((char (schar namestr i)))
203                      (when (eql char #\~)                      (when (eql char #\~)
204                        (return (if (char= (schar namestr (1- i)) #\.)                        (return (if (char= (schar namestr (1- i)) #\.)
# Line 438  Line 447 
447            (error "Cannot specify the type without a file: ~S" pathname))            (error "Cannot specify the type without a file: ~S" pathname))
448          (strings ".")          (strings ".")
449          (strings (unparse-unix-piece type)))          (strings (unparse-unix-piece type)))
450          (when (and version (not name))
451            ;; We don't want version without a name, because when we try
452            ;; to read #p".~*~" back, the name is "", not NIL.
453            (error "Cannot specify a version without a file: ~S" pathname))
454        (when version-supplied        (when version-supplied
455          (strings (if (eq version :wild)          (strings (if (eq version :wild)
456                       (if logical-p ".*" ".~*~")                       (if logical-p ".*" ".~*~")

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82

  ViewVC Help
Powered by ViewVC 1.1.5