tweaks: avoid passing NULL to access()
This prevents an unwanted message when nano is compiled with -fsanitize=undefined. This fixes https://savannah.gnu.org/bugs/?63447. Problem existed since version 4.8, commit 343f97b3, since the --rcfile option was added.
Этот коммит содержится в:
родитель
4f92b12a6a
Коммит
846588ee81
@ -1707,7 +1707,7 @@ void do_rcfiles(void)
|
||||
{
|
||||
if (custom_nanorc) {
|
||||
nanorc = get_full_path(custom_nanorc);
|
||||
if (access(nanorc, F_OK) != 0)
|
||||
if (nanorc == NULL || access(nanorc, F_OK) != 0)
|
||||
die(_("Specified rcfile does not exist\n"));
|
||||
} else
|
||||
nanorc = mallocstrcpy(nanorc, SYSCONFDIR "/nanorc");
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user