summaryrefslogtreecommitdiff
path: root/line-range.c
diff options
context:
space:
mode:
Diffstat (limited to 'line-range.c')
-rw-r--r--line-range.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/line-range.c b/line-range.c
index 3942475c2f..a816951e06 100644
--- a/line-range.c
+++ b/line-range.c
@@ -26,6 +26,8 @@ static const char *parse_loc(const char *spec, nth_line_fn_t nth_line,
if (term != spec + 1) {
if (!ret)
return term;
+ if (num == 0)
+ die("-L invalid empty range");
if (spec[0] == '-')
num = 0 - num;
if (0 < num)