Skip to content
Snippets Groups Projects
Commit cc4323a9 authored by rswindell's avatar rswindell
Browse files

Fix bug in last commit - must call WSAStartup on Windows for gethostname() to

work in iniFileName().
parent 25d3b1db
No related branches found
No related tags found
No related merge requests found
......@@ -77,12 +77,21 @@ void sbbs_get_ini_fname(char* ini_file, char* ctrl_dir, char* pHostName)
{
/* pHostName is no longer used since iniFileName calls gethostname() itself */
#if defined(_WINSOCKAPI_)
WSADATA WSAData;
WSAStartup(MAKEWORD(1,1), &WSAData); /* req'd for gethostname */
#endif
#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 defined(_WINSOCKAPI_)
WSACleanup();
#endif
}
static void sbbs_fix_js_settings(js_startup_t* js)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment