Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'line-range.c')
-rw-r--r--line-range.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/line-range.c b/line-range.c
index bbf3c0f448..70484899ac 100644
--- a/line-range.c
+++ b/line-range.c
@@ -59,8 +59,14 @@ static const char *parse_loc(const char *spec, nth_line_fn_t nth_line,
return term;
}
- if (begin < 0)
- begin = -begin;
+ if (begin < 0) {
+ if (spec[0] != '^')
+ begin = -begin;
+ else {
+ begin = 1;
+ spec++;
+ }
+ }
if (spec[0] != '/')
return spec;