t8001/t8002: blame: demonstrate acceptance of bogus -L,+0 and -L,-0
[gitweb.git] / line-range.c
index 3942475c2fc8e48c7f0a2d7808f77a4f71a1cde6..a816951e067a89516c584fb97152973f7786af46 100644 (file)
@@ -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)