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

Support path/file.<host>.ini in addition to path/file.<host.domain>.ini in

iniFileName().
parent 1b5883b4
No related branches found
No related tags found
No related merge requests found
......@@ -881,14 +881,20 @@ char* iniFileName(char* dest, size_t maxlen, const char* indir, const char* infn
if(gethostname(hostname,sizeof(hostname))==0) {
safe_snprintf(dest,maxlen,"%s%s.%s%s",dir,fname,hostname,ext);
if(fexistcase(dest))
if(fexistcase(dest)) /* path/file.host.domain.ini */
return(dest);
if((p=strchr(hostname,'.'))!=NULL) {
*p=0;
safe_snprintf(dest,maxlen,"%s%s.%s%s",dir,fname,hostname,ext);
if(fexistcase(dest)) /* path/file.host.ini */
return(dest);
}
}
}
#endif
safe_snprintf(dest,maxlen,"%s%s%s",dir,fname,ext);
fexistcase(dest);
fexistcase(dest); /* path/file.ini */
return(dest);
}
......
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