mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-25 20:43:03 +01:00
Fix error messages being printed when autorun_path is unset.
This commit is contained in:
parent
22ea522baf
commit
369f26932e
@ -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);
|
||||
|
@ -195,6 +195,7 @@ static void tox_defaults(struct user_settings *settings)
|
||||
strcpy(settings->download_path, "");
|
||||
strcpy(settings->chatlogs_path, "");
|
||||
strcpy(settings->avatar_path, "");
|
||||
strcpy(settings->autorun_path, "");
|
||||
strcpy(settings->password_eval, "");
|
||||
}
|
||||
|
||||
@ -421,6 +422,7 @@ int settings_load(struct user_settings *s, const char *patharg)
|
||||
}
|
||||
|
||||
#ifdef PYTHON
|
||||
|
||||
if ( config_setting_lookup_string(setting, tox_strings.autorun_path, &str) ) {
|
||||
snprintf(s->autorun_path, sizeof(s->autorun_path), "%s", str);
|
||||
int len = strlen(str);
|
||||
@ -430,6 +432,7 @@ int settings_load(struct user_settings *s, const char *patharg)
|
||||
else if (s->autorun_path[len - 1] != '/')
|
||||
strcat(&s->autorun_path[len - 1], "/");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if ( config_setting_lookup_string(setting, tox_strings.password_eval, &str) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user