blame: reject empty ranges -L,+0 and -L,-0
[gitweb.git] / line-range.c
index a816951e067a89516c584fb97152973f7786af46..69e8d6b6c02101b4243e1850aa52c377ccaa0a2b 100644 (file)
@@ -21,7 +21,7 @@ static const char *parse_loc(const char *spec, nth_line_fn_t nth_line,
         * for 20 lines, or "-L <something>,-5" for 5 lines ending at
         * <something>.
         */
-       if (1 < begin && (spec[0] == '+' || spec[0] == '-')) {
+       if (1 <= begin && (spec[0] == '+' || spec[0] == '-')) {
                num = strtol(spec + 1, &term, 10);
                if (term != spec + 1) {
                        if (!ret)