1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-28 10:36:45 +02:00

Fix error messages being printed when autorun_path is unset.

This commit is contained in:
jakob
2017-05-23 19:12:53 -04:00
parent 22ea522baf
commit 369f26932e
2 changed files with 9 additions and 1 deletions

View File

@ -169,9 +169,14 @@ void invoke_autoruns(WINDOW *window, ToxWindow *self)
struct dirent *dir;
char abspath_buf[PATH_MAX + 1], err_buf[PATH_MAX + 1];
size_t path_len;
DIR *d = opendir(user_settings->autorun_path);
DIR *d;
FILE *fp;
if (user_settings->autorun_path[0] == '\0')
return;
d = opendir(user_settings->autorun_path);
if (d == NULL) {
snprintf(err_buf, PATH_MAX + 1, "Autorun path does not exist: %s", user_settings->autorun_path);
api_display(err_buf);