1
0
forked from aniani/vim

patch 8.2.0316: ex_getln.c code has insufficient test coverage

Problem:    ex_getln.c code has insufficient test coverage.
Solution:   Add more tests. Fix a problem. (Yegappan Lakshmanan, closes #5693)
This commit is contained in:
Bram Moolenaar
2020-02-25 21:47:45 +01:00
parent c593bec412
commit 8d588ccee5
6 changed files with 163 additions and 1 deletions

View File

@@ -389,7 +389,7 @@ calc_hist_idx(int histype, int num)
i += hislen;
wrapped = TRUE;
}
if (hist[i].hisnum == num && hist[i].hisstr != NULL)
if (i >= 0 && hist[i].hisnum == num && hist[i].hisstr != NULL)
return i;
}
else if (-num <= hislen)