mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
Remove OOM checks: backslash_halve_save()
This commit is contained in:
@@ -1910,6 +1910,7 @@ void backslash_halve(char_u *p)
|
|||||||
/// @return String with the number of backslashes halved.
|
/// @return String with the number of backslashes halved.
|
||||||
char_u* backslash_halve_save(char_u *p)
|
char_u* backslash_halve_save(char_u *p)
|
||||||
{
|
{
|
||||||
|
// TODO(philix): simplify and improve backslash_halve_save algorithm
|
||||||
char_u *res = vim_strsave(p);
|
char_u *res = vim_strsave(p);
|
||||||
backslash_halve(res);
|
backslash_halve(res);
|
||||||
return res;
|
return res;
|
||||||
|
@@ -3213,8 +3213,7 @@ static int showmatches(expand_T *xp, int wildmenu)
|
|||||||
exp_path = expand_env_save_opt(files_found[k], TRUE);
|
exp_path = expand_env_save_opt(files_found[k], TRUE);
|
||||||
halved_slash = backslash_halve_save(
|
halved_slash = backslash_halve_save(
|
||||||
exp_path != NULL ? exp_path : files_found[k]);
|
exp_path != NULL ? exp_path : files_found[k]);
|
||||||
j = os_isdir(halved_slash != NULL ? halved_slash
|
j = os_isdir(halved_slash);
|
||||||
: files_found[k]);
|
|
||||||
free(exp_path);
|
free(exp_path);
|
||||||
free(halved_slash);
|
free(halved_slash);
|
||||||
} else
|
} else
|
||||||
|
Reference in New Issue
Block a user