GNU bug report logs - #24725
25.1.50; vc-region-history may exceed max line number of file in repository

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Tue, 18 Oct 2016 14:28:01 UTC

Severity: normal

Tags: patch

Found in version 25.1.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Schwab <schwab <at> suse.de>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 24725 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#24725: 25.1.50; vc-region-history may exceed max line number of file in repository
Date: Thu, 20 Oct 2016 09:27:22 +0200
On Okt 20 2016, Tino Calancha <tino.calancha <at> gmail.com> wrote:

> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index 9eac5b2..c6a9064 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -1016,6 +1016,8 @@ vc-git-region-history
>    ;; FIXME: Maybe this should be done in vc.el (i.e. for all backends), but
>    ;; since Git is the only backend to support this operation so far, it's hard
>    ;; to tell.
> +  (when (> lto (line-number-at-pos (1- (point-max))))
> +    (setq lto (line-number-at-pos (1- (point-max)))))

Shouldn't that be fixed in the caller, and lto always be decremented if
the regions ends at bol?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




This bug report was last modified 8 years and 212 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.