Skip to content
Snippets Groups Projects
Commit f778a144 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Use the screen modes enum, not names array for ini parsing

Any screen mode where the description and the enum value were not
identical (ie: ones with spaces or parenthesis) would not be used
at startup correctly.

Reported by DigitalMan via Discord
parent 4c2ec210
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2292 passed
......@@ -188,8 +188,8 @@ static struct sort_order_info sort_order[] = {
int sortorder[sizeof(sort_order)/sizeof(struct sort_order_info)];
char *screen_modes[]={ "Current", "80x25", "LCD 80x25", "80x28", "80x30", "80x43", "80x50", "80x60", "132x37 (16:9)", "132x52 (5:4)", "132x25", "132x28", "132x30", "132x34", "132x43", "132x50", "132x60", "C64", "C128 (40col)", "C128 (80col)", "Atari", "Atari XEP80", "Custom", "EGA 80x25", "VGA 80x25", NULL};
static char *screen_modes_enum[]={"Current", "80x25", "LCD80x25", "80x28", "80x30", "80x43", "80x50", "80x60", "132x37", "132x52", "132x25", "132x28", "132x30", "132x34", "132x43", "132x50", "132x60", "C64", "C128-40col", "C128-80col", "Atari", "Atari-XEP80", "Custom", "EGA80x25", "VGA80x25", NULL};
static char *screen_modes[]={ "Current", "80x25", "LCD 80x25", "80x28", "80x30", "80x43", "80x50", "80x60", "132x37 (16:9)", "132x52 (5:4)", "132x25", "132x28", "132x30", "132x34", "132x43", "132x50", "132x60", "C64", "C128 (40col)", "C128 (80col)", "Atari", "Atari XEP80", "Custom", "EGA 80x25", "VGA 80x25", NULL};
char *screen_modes_enum[]={"Current", "80x25", "LCD80x25", "80x28", "80x30", "80x43", "80x50", "80x60", "132x37", "132x52", "132x25", "132x28", "132x30", "132x34", "132x43", "132x50", "132x60", "C64", "C128-40col", "C128-80col", "Atari", "Atari-XEP80", "Custom", "EGA80x25", "VGA80x25", NULL};
char *log_levels[]={"Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Info", "Debug", NULL};
static char *log_level_desc[]={"None", "Alerts", "Critical Errors", "Errors", "Warnings", "Notices", "Normal", "All (Debug)", NULL};
......
......@@ -116,7 +116,7 @@ extern char *rate_names[];
extern int rates[];
extern int sortorder[];
extern ini_style_t ini_style;
extern char *screen_modes[];
extern char *screen_modes_enum[];
void read_item(str_list_t listfile, struct bbslist *entry, char *bbsname, int id, int type);
void read_list(char *listpath, struct bbslist **list, struct bbslist *defaults, int *i, int type);
void free_list(struct bbslist **list, int listcount);
......
......@@ -1248,8 +1248,8 @@ void load_settings(struct syncterm_settings *set)
inifile=fopen(inipath,"r");
set->confirm_close=iniReadBool(inifile,"SyncTERM","ConfirmClose",FALSE);
set->prompt_save=iniReadBool(inifile,"SyncTERM","PromptSave",TRUE);
set->startup_mode=iniReadEnum(inifile,"SyncTERM","VideoMode",screen_modes,SCREEN_MODE_CURRENT);
set->startup_mode=iniReadEnum(inifile,"SyncTERM","ScreenMode",screen_modes,set->startup_mode);
set->startup_mode=iniReadEnum(inifile,"SyncTERM","VideoMode",screen_modes_enum,SCREEN_MODE_CURRENT);
set->startup_mode=iniReadEnum(inifile,"SyncTERM","ScreenMode",screen_modes_enum,set->startup_mode);
set->output_mode=iniReadEnum(inifile,"SyncTERM","OutputMode",output_enum,CIOLIB_MODE_AUTO);
set->backlines=iniReadInteger(inifile,"SyncTERM","ScrollBackLines",2000);
set->xfer_success_keypress_timeout=iniReadInteger(inifile,"SyncTERM", "TransferSuccessKeypressTimeout", /* seconds: */0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment