mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
fix(api): fix nvim_cmd crash with filename expansion (#20397)
This commit is contained in:
@@ -3887,7 +3887,7 @@ static char *repl_cmdline(exarg_T *eap, char *src, size_t srclen, char *repl, ch
|
||||
} else {
|
||||
// Otherwise, argument gets shifted alongside the replaced text.
|
||||
// The amount of the shift is equal to the difference of the old and new string length.
|
||||
eap->args[j] = new_cmdline + (eap->args[j] - *cmdlinep) + (len - srclen);
|
||||
eap->args[j] = new_cmdline + ((eap->args[j] - *cmdlinep) + (ptrdiff_t)(len - srclen));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user