mirror of
https://github.com/irssi/irssi.git
synced 2026-08-22 18:12:12 +02:00
Display message and exit if backup config still exists when launching
This commit is contained in:
parent
1ef9b5e5c7
commit
55f4423963
1 changed files with 11 additions and 1 deletions
|
|
@ -187,9 +187,10 @@ void core_register_options(void)
|
|||
|
||||
void core_preinit(const char *path)
|
||||
{
|
||||
const char *home;
|
||||
const char *home, *backup_config_file;
|
||||
char *str;
|
||||
int len;
|
||||
FILE *fp;
|
||||
|
||||
if (irssi_dir == NULL) {
|
||||
home = g_get_home_dir();
|
||||
|
|
@ -213,6 +214,15 @@ void core_preinit(const char *path)
|
|||
g_free(str);
|
||||
}
|
||||
|
||||
backup_config_file = g_strdup_printf("%s/"IRSSI_HOME_CONFIG_BACKUP, irssi_dir);
|
||||
/* if backup_config_file still exists, but irssi was launched with a different config, something is wrong */
|
||||
if ((fp = fopen(backup_config_file, "r")) != NULL && g_strcmp0(backup_config_file, irssi_config_file) != 0) {
|
||||
fclose(fp);
|
||||
signal_emit("gui exit", 0);
|
||||
printf("Backup config %s still exists. Please merge into %s and then remove %s before starting irssi.\n", backup_config_file, irssi_config_file, backup_config_file);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
session_set_binary(path);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue