diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-02 15:30:41 -0700 |
commit | 6566a917d8a8d3070b5fdc94fbe5f6d68a4d656b (patch) | |
tree | 5a8ac927a48d840786c5cca578221008f2baf9d1 /line-range.c | |
parent | Merge branch 'jt/fetch-pack-negotiator' (diff) | |
parent | log: prevent error if line range ends past end of file (diff) | |
download | tgif-6566a917d8a8d3070b5fdc94fbe5f6d68a4d656b.tar.xz |
Merge branch 'is/parsing-line-range'
Parsing of -L[<N>][,[<M>]] parameters "git blame" and "git log"
take has been tweaked.
* is/parsing-line-range:
log: prevent error if line range ends past end of file
blame: prevent error if range ends past end of file
Diffstat (limited to 'line-range.c')
-rw-r--r-- | line-range.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/line-range.c b/line-range.c index 323399d16c..232c3909ec 100644 --- a/line-range.c +++ b/line-range.c @@ -47,7 +47,7 @@ static const char *parse_loc(const char *spec, nth_line_fn_t nth_line, else if (!num) *ret = begin; else - *ret = begin + num; + *ret = begin + num > 0 ? begin + num : 1; return term; } return spec; |