From 9515cdccc0c3ce9b2be52e1614dcd9f8ccc1ed00 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 1 Oct 2009 02:23:29 +0000 Subject: [PATCH] (vc-cvs-parse-entry): Be more careful with the match-data. (Bug#4555). --- lisp/ChangeLog | 3 +++ lisp/vc-cvs.el | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index decde262f49..e71b1b2f34d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-10-01 Glenn Morris + * vc-cvs.el (vc-cvs-parse-entry): Be more careful with the + match-data. (Bug#4555). + * cedet/semantic/bovine/gcc.el (semantic-c-reset-preprocessor-symbol-map): Fix declaration. (semantic-gcc-get-include-paths, semantic-gcc-setup-data): Doc fixes. diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 2d433b08e26..1cc971a58af 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -955,6 +955,7 @@ state." ) ;; Based on vc-cvs-dir-state-heuristic from Emacs 22. +;; FIXME does not mention unregistered files. (defun vc-cvs-dir-status-heuristic (dir update-function &optional basedir) "Find the CVS state of all files in DIR, using only local information." (let (file basename status result dirlist) @@ -1164,18 +1165,18 @@ is non-nil." ;; This is intentionally different from the algorithm that CVS uses ;; (which is based on textual comparison), because there can be problems ;; generating a time string that looks exactly like the one from CVS. - (let ((mtime (nth 5 (file-attributes file)))) - (require 'parse-time) - (let ((parsed-time - (parse-time-string (concat (match-string 2) " +0000")))) - (cond ((and (not (string-match "\\+" (match-string 2))) - (car parsed-time) - (equal mtime (apply 'encode-time parsed-time))) - (vc-file-setprop file 'vc-checkout-time mtime) - (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) - (t - (vc-file-setprop file 'vc-checkout-time 0) - (if set-state (vc-file-setprop file 'vc-state 'edited))))))))) + (let* ((time (match-string 2)) + (mtime (nth 5 (file-attributes file))) + (parsed-time (progn (require 'parse-time) + (parse-time-string (concat time " +0000"))))) + (cond ((and (not (string-match "\\+" time)) + (car parsed-time) + (equal mtime (apply 'encode-time parsed-time))) + (vc-file-setprop file 'vc-checkout-time mtime) + (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) + (t + (vc-file-setprop file 'vc-checkout-time 0) + (if set-state (vc-file-setprop file 'vc-state 'edited)))))))) ;; Completion of revision names. ;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use -- 2.39.2