Commit ce27f264 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(vc-consult-rcs-headers): Use an even more

pedantic regexp to match RCS time strings.  Improved
efficiency by using looking-at instead of re-search "\\=...
parent eb6a9dca
...@@ -346,11 +346,12 @@ value of this flag.") ...@@ -346,11 +346,12 @@ value of this flag.")
(let ((rev (buffer-substring (match-beginning 1) (let ((rev (buffer-substring (match-beginning 1)
(match-end 1)))) (match-end 1))))
;; ... and check for the locking state ;; ... and check for the locking state
(if (re-search-forward (cond
(concat "\\=[0-9]+[/-][0-9]+[/-][0-9]+ " ; date ((looking-at
"[0-9]+:[0-9]+:[0-9]+\\([+-][0-9:]+\\)? " ; time (concat "[0-9]+[/-][01][0-9][/-][0-3][0-9] " ; date
"[^ ]+ [^ ]+ ") ; author & state "[0-2][0-9]:[0-5][0-9]+:[0-6][0-9]+\\([+-][0-9:]+\\)? " ; time
nil t) "[^ ]+ [^ ]+ ")) ; author & state
(goto-char (match-end 0)) ; [0-6] in regexp handles leap seconds
(cond (cond
;; unlocked revision ;; unlocked revision
((looking-at "\\$") ((looking-at "\\$")
...@@ -365,10 +366,10 @@ value of this flag.") ...@@ -365,10 +366,10 @@ value of this flag.")
(match-end 1))) (match-end 1)))
'rev-and-lock) 'rev-and-lock)
;; everything else: false ;; everything else: false
(nil)) (nil)))
;; unexpected information in ;; unexpected information in
;; keyword string --> quit ;; keyword string --> quit
nil))) (nil))))
;; search for $Revision ;; search for $Revision
;; -------------------- ;; --------------------
((re-search-forward (concat "\\$" ((re-search-forward (concat "\\$"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment