Mercurial > vim
comparison src/cmdhist.c @ 19517:738a4fe2c8c5 v8.2.0316
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Commit: https://github.com/vim/vim/commit/8d588ccee57390aa01c2395fc599bbe6506ee13a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 25 21:47:45 2020 +0100
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 https://github.com/vim/vim/issues/5693)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 25 Feb 2020 22:00:04 +0100 |
parents | 04245f071792 |
children | 4dfd00f481fb |
comparison
equal
deleted
inserted
replaced
19516:209388e9e179 | 19517:738a4fe2c8c5 |
---|---|
387 if (wrapped) | 387 if (wrapped) |
388 break; | 388 break; |
389 i += hislen; | 389 i += hislen; |
390 wrapped = TRUE; | 390 wrapped = TRUE; |
391 } | 391 } |
392 if (hist[i].hisnum == num && hist[i].hisstr != NULL) | 392 if (i >= 0 && hist[i].hisnum == num && hist[i].hisstr != NULL) |
393 return i; | 393 return i; |
394 } | 394 } |
395 else if (-num <= hislen) | 395 else if (-num <= hislen) |
396 { | 396 { |
397 i += num + 1; | 397 i += num + 1; |