mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
gcc/analyzer: fix false positives for NULL (#13248)
Close https://github.com/neovim/neovim/issues/13158
This commit is contained in:
@@ -3451,13 +3451,13 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
|
||||
|
||||
sub_firstline = NULL;
|
||||
|
||||
/*
|
||||
* ~ in the substitute pattern is replaced with the old pattern.
|
||||
* We do it here once to avoid it to be replaced over and over again.
|
||||
* But don't do it when it starts with "\=", then it's an expression.
|
||||
*/
|
||||
if (!(sub[0] == '\\' && sub[1] == '='))
|
||||
// ~ in the substitute pattern is replaced with the old pattern.
|
||||
// We do it here once to avoid it to be replaced over and over again.
|
||||
// But don't do it when it starts with "\=", then it's an expression.
|
||||
assert(sub != NULL);
|
||||
if (!(sub[0] == '\\' && sub[1] == '=')) {
|
||||
sub = regtilde(sub, p_magic);
|
||||
}
|
||||
|
||||
// Check for a match on each line.
|
||||
// If preview: limit to max('cmdwinheight', viewport).
|
||||
|
||||
Reference in New Issue
Block a user