From 6dccd65657f2f6fbff03a8f16e4eec12404f1039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Mon, 6 Jan 2025 16:45:56 -0500 Subject: [PATCH] When we set the title, grab the length and use it. Since "FreeBSD" is longer than "Win32" or "Linux", we can't use a fixed position/length here or the version number will get chopped off. --- src/sbbs3/scfg/scfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/scfg/scfg.c b/src/sbbs3/scfg/scfg.c index 83079e81c6..ea77aec538 100644 --- a/src/sbbs3/scfg/scfg.c +++ b/src/sbbs3/scfg/scfg.c @@ -48,6 +48,7 @@ char tmp[256]; char error[256]; char* area_sort_desc[] = { "Index Position", "Long Name", "Short Name", "Internal Code Suffix", NULL }; static char title[128]; +size_t title_len; const char* hostname = NULL; int ciolib_mode = CIOLIB_MODE_AUTO; enum text_modes video_mode = LCD80X25; @@ -406,10 +407,10 @@ void display_filename(BOOL force) { static char last[MAX_PATH + 1]; const char* fname = cfg.filename; - if(strlen(fname) + 30 > uifc.scrn_width) + if(strlen(fname) + title_len + 5 > uifc.scrn_width) fname = getfname(fname); if(force || strcmp(last, fname) != 0) - uifc.printf(29, 1, uifc.bclr|(uifc.cclr<<4), "%*s", uifc.scrn_width - 30, fname); + uifc.printf(title_len + 4, 1, uifc.bclr|(uifc.cclr<<4), "%*s", uifc.scrn_width - (title_len + 5), fname); SAFECOPY(last, fname); } @@ -764,6 +765,7 @@ int main(int argc, char **argv) printf(" USCRN (len=%d) failed!\n",uifc.scrn_len+1); bail(1); } + title_len = strlen(title); SAFEPRINTF(cfg_fname, "%smain.ini", cfg.ctrl_dir); if(!fexist(cfg_fname)) { -- GitLab