mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
API: Bugfix: Fix loop condition in vim_list_runtime_paths
This commit is contained in:
parent
ee60683b9a
commit
c6483aa2fa
@ -94,14 +94,12 @@ StringArray vim_list_runtime_paths(void)
|
|||||||
rtp++;
|
rtp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// index
|
|
||||||
uint32_t i = 0;
|
|
||||||
// Allocate memory for the copies
|
// Allocate memory for the copies
|
||||||
rv.items = xmalloc(sizeof(String) * rv.size);
|
rv.items = xmalloc(sizeof(String) * rv.size);
|
||||||
// reset the position
|
// reset the position
|
||||||
rtp = p_rtp;
|
rtp = p_rtp;
|
||||||
// Start copying
|
// Start copying
|
||||||
while (*rtp != NUL) {
|
for (size_t i = 0; i < rv.size && *rtp != NUL; i++) {
|
||||||
rv.items[i].data = xmalloc(MAXPATHL);
|
rv.items[i].data = xmalloc(MAXPATHL);
|
||||||
// Copy the path from 'runtimepath' to rv.items[i]
|
// Copy the path from 'runtimepath' to rv.items[i]
|
||||||
int length = copy_option_part(&rtp,
|
int length = copy_option_part(&rtp,
|
||||||
@ -110,7 +108,6 @@ StringArray vim_list_runtime_paths(void)
|
|||||||
",");
|
",");
|
||||||
assert(length >= 0);
|
assert(length >= 0);
|
||||||
rv.items[i].size = (size_t)length;
|
rv.items[i].size = (size_t)length;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
Loading…
Reference in New Issue
Block a user