mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3947: unnecessary check for NULL pointer
Problem: Unnecessary check for NULL pointer.
Solution: Remove the check. (closes vim/vim#9434)
f38aad85cf
Reorder the two if branches to match upstream.
This commit is contained in:
parent
2559359035
commit
1bce6d6e16
@ -7870,9 +7870,11 @@ bool changedir_func(char_u *new_dir, CdScope scope)
|
|||||||
new_dir = NameBuff;
|
new_dir = NameBuff;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dir_differs = new_dir == NULL || pdir == NULL
|
bool dir_differs = pdir == NULL || pathcmp((char *)pdir, (char *)new_dir, -1) != 0;
|
||||||
|| pathcmp((char *)pdir, (char *)new_dir, -1) != 0;
|
if (dir_differs && vim_chdir(new_dir) != 0) {
|
||||||
if (new_dir != NULL && (!dir_differs || vim_chdir(new_dir) == 0)) {
|
emsg(_(e_failed));
|
||||||
|
xfree(pdir);
|
||||||
|
} else {
|
||||||
char_u **pp;
|
char_u **pp;
|
||||||
|
|
||||||
switch (scope) {
|
switch (scope) {
|
||||||
@ -7890,9 +7892,6 @@ bool changedir_func(char_u *new_dir, CdScope scope)
|
|||||||
|
|
||||||
post_chdir(scope, dir_differs);
|
post_chdir(scope, dir_differs);
|
||||||
retval = true;
|
retval = true;
|
||||||
} else {
|
|
||||||
emsg(_(e_failed));
|
|
||||||
xfree(pdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
Loading…
Reference in New Issue
Block a user