From d35747c0ec93561bf35bd8e5e105aba74c147f92 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Tue, 23 Feb 2010 00:21:32 +0000 Subject: [PATCH] Reduce the number of startup initialization files supported to just 1. ctrl/sbbs[.host][.domain].ini and 2. ctrl/sbbs[.os].ini Gone are support for ctrl/[host][.domain].ini and startup[.*].ini as they just provided potential confusion and problems (e.g. hostnames conflicting with other .ini filenames). --- src/sbbs3/sbbs_ini.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/src/sbbs3/sbbs_ini.c b/src/sbbs3/sbbs_ini.c index 830c2d4dbf..1a0dcf7002 100644 --- a/src/sbbs3/sbbs_ini.c +++ b/src/sbbs3/sbbs_ini.c @@ -8,7 +8,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -75,42 +75,14 @@ static const char* strSemFileCheckFrequency ="SemFileCheckFrequency"; void sbbs_get_ini_fname(char* ini_file, char* ctrl_dir, char* pHostName) { - char host_name[128]; - char path[MAX_PATH+1]; - char* p; - - if(pHostName!=NULL) - SAFECOPY(host_name,pHostName); - else { -#if defined(_WINSOCKAPI_) - WSADATA WSAData; - WSAStartup(MAKEWORD(1,1), &WSAData); /* req'd for gethostname */ -#endif - gethostname(host_name,sizeof(host_name)-1); -#if defined(_WINSOCKAPI_) - WSACleanup(); -#endif - } - SAFECOPY(path,ctrl_dir); - backslash(path); - sprintf(ini_file,"%s%s.ini",path,host_name); - if(fexistcase(ini_file)) - return; - if((p=strchr(host_name,'.'))!=NULL) { - *p=0; - sprintf(ini_file,"%s%s.ini",path,host_name); - if(fexistcase(ini_file)) - return; - } + /* pHostName is no longer used since iniFileName calls gethostname() itself */ + #if defined(__unix__) && defined(PREFIX) sprintf(ini_file,PREFIX"/etc/sbbs.ini"); if(fexistcase(ini_file)) return; #endif iniFileName(ini_file,MAX_PATH,ctrl_dir,"sbbs.ini"); - if(fexistcase(ini_file)) - return; - iniFileName(ini_file,MAX_PATH,ctrl_dir,"startup.ini"); } static void sbbs_fix_js_settings(js_startup_t* js) -- GitLab