/[meta-cvs]/meta-cvs/F-123D61C8FE941733281D2B08C15CD438
ViewVC logotype

Diff of /meta-cvs/F-123D61C8FE941733281D2B08C15CD438

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

revision 1.18 by kaz, Mon Oct 7 02:25:29 2002 UTC revision 1.18.2.7 by kaz, Thu Jan 29 04:53:13 2004 UTC
# Line 10  Line 10 
10    (defconstant *this-dir* ".")    (defconstant *this-dir* ".")
11    (defconstant *path-sep* "/"))    (defconstant *path-sep* "/"))
12    
13  (defvar *editor* nil)  (defvar *mcvs-editor* nil)
14    
15    (defconstant *argument-limit* (* 64 1024))
16    
17  (defun canonicalize-path (path)  (defun canonicalize-path (path)
18  "Simplifies a POSIX path by eliminating . components, splicing out as many ..  "Simplifies a POSIX path by eliminating . components, splicing out as many ..
# Line 103  name, and does not count as the rightmos Line 105  name, and does not count as the rightmos
105          (values (subseq path (1+ pos1)) (subseq path 0 pos1))))))          (values (subseq path (1+ pos1)) (subseq path 0 pos1))))))
106    
107  (defun suffix (path &optional (separator-char #\.))  (defun suffix (path &optional (separator-char #\.))
108    (let ((name (basename path)))    (multiple-value-bind (name dir)
109                           (basename path)
110      (let ((pos (position separator-char name)))      (let ((pos (position separator-char name)))
111        (cond        (cond
112          ((eql pos 0)          ((eql pos 0)
113             (values nil name))             (values nil name dir))
114          (pos          (pos
115             (values (subseq name (1+ pos)) (subseq name 0 pos)))             (values (subseq name (1+ pos)) (subseq name 0 pos) dir))
116          (t (values nil name))))))          (t (values nil name dir))))))
117    
118    (declaim (inline path-equal))
119  (defun path-equal (p1 p2)  (defun path-equal (p1 p2)
120    (string= p1 p2))    (string= p1 p2))
 (declaim (inline path-equal))  
121    
122  (defun path-prefix-equal (shorter longer)  (defun path-prefix-equal (shorter longer)
123    (let ((ls (length shorter)) (ll (length longer)))    (let ((ls (length shorter)) (ll (length longer)))
# Line 174  interpreter. This requires escaping of a Line 177  interpreter. This requires escaping of a
177                               :initial-value 0))                               :initial-value 0))
178           (size fixed-size))           (size fixed-size))
179      (if extra-args      (if extra-args
180        (let (chopped-arg)        (let ((chopped-arg ())
181                (combined-status t))
182          (dolist (arg extra-args)          (dolist (arg extra-args)
183            (push arg chopped-arg)            (push arg chopped-arg)
184            (when (> (incf size (1+ (length arg))) *argument-limit*)            (when (> (incf size (1+ (length arg))) *argument-limit*)
185              (when (not (execute-program (append fixed-args              (setf combined-status
186                      (and combined-status
187                           (execute-program (append fixed-args
188                                                  (nreverse chopped-arg)                                                  (nreverse chopped-arg)
189                                                  fixed-trail-args)))                                                  fixed-trail-args))))
               (return nil))  
190              (setf chopped-arg nil)              (setf chopped-arg nil)
191              (setf size fixed-size)))              (setf size fixed-size)))
192          (when chopped-arg          (when chopped-arg
193            (execute-program (append fixed-args (nreverse chopped-arg)            (execute-program (append fixed-args (nreverse chopped-arg)
194                                     fixed-trail-args))))                                     fixed-trail-args)))
195        (execute-program fixed-args))))          combined-status)
196          (execute-program (append fixed-args fixed-trail-args)))))
197    
198  (defun invoke-editor-on (name)  (defun invoke-editor-on (name)
199    (let ((editor (or *editor* (env-lookup "EDITOR" "vi"))))    (let ((editor (or *mcvs-editor*
200                        (env-lookup "CVSEDITOR")
201                        (env-lookup "VISUAL")
202                        (env-lookup "EDITOR" "vi"))))
203      (execute-program `(,editor ,name))))      (execute-program `(,editor ,name))))

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.18.2.7

  ViewVC Help
Powered by ViewVC 1.1.5