Commit c811fe9d authored by rswindell's avatar rswindell
Browse files

More filename case-insensitivity fixes for Unix file systems using fexistcase.

parent e5d72413
......@@ -888,7 +888,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
case CHKFILE_VAR:
pp=getstrvar(csi,*(long *)csi->ip);
csi->ip+=4;
if(pp && *pp && fexist(cmdstr(*pp,path,csi->str,buf)))
if(pp && *pp && fexistcase(cmdstr(*pp,path,csi->str,buf)))
csi->logic=LOGIC_TRUE;
else
csi->logic=LOGIC_FALSE;
......
......@@ -222,7 +222,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
sprintf(tmp,"%s%s", cfg.node_dir, cfg.data_dir);
sprintf(str,"%sfile/%04u.out/%s",tmp,useron.number,fname);
strcpy(subj,str);
if(fexist(str)) {
if(fexistcase(str)) {
bputs(text[FileAlreadyThere]);
return(false); }
if(online==ON_LOCAL) { /* Local upload */
......@@ -305,7 +305,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
while(1) {
for(i=1;i;i++) {
sprintf(str,"%s%u.msg", cfg.netmail_dir,i);
if(!fexist(str))
if(!fexistcase(str))
break; }
if(!i) {
bputs(text[TooManyEmailsToday]);
......@@ -824,7 +824,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
for(i=1;i;i++) {
sprintf(str,"%s%u.msg", cfg.netmail_dir,i);
if(!fexist(str))
if(!fexistcase(str))
break; }
if(!i) {
bputs(text[TooManyEmailsToday]);
......
......@@ -392,7 +392,7 @@ int main(int argc, char **argv)
if(misc&MINUS) {
sprintf(str,"%s%s",scfg.dir[i]->path,fname);
if(!fexist(str))
if(!fexistcase(str))
fputc('-',out);
else
fputc(SP,out); }
......
......@@ -2475,12 +2475,12 @@ int sbbs_t::mv(char *src, char *dest, char copy)
if(!stricmp(src,dest)) /* source and destination are the same! */
return(0);
if(!fexist(src)) {
if(!fexistcase(src)) {
bprintf("\r\n\7MV ERROR: Source doesn't exist\r\n'%s'\r\n"
,src);
return(-1);
}
if(!copy && fexist(dest)) {
if(!copy && fexistcase(dest)) {
bprintf("\r\n\7MV ERROR: Destination already exists\r\n'%s'\r\n"
,dest);
return(-1);
......@@ -2937,7 +2937,7 @@ void node_thread(void* arg)
sbbs->useron.shell=0;
sprintf(str,"%s%s.bin",sbbs->cfg.mods_dir
,sbbs->cfg.shell[sbbs->useron.shell]->code);
if(sbbs->cfg.mods_dir[0]==0 || !fexist(str))
if(sbbs->cfg.mods_dir[0]==0 || !fexistcase(str))
sprintf(str,"%s%s.bin",sbbs->cfg.exec_dir
,sbbs->cfg.shell[sbbs->useron.shell]->code);
if((file=sbbs->nopen(str,O_RDONLY))==-1) {
......
......@@ -99,7 +99,7 @@ bool sbbs_t::inetmail(char *into, char *subj, long mode)
sprintf(str2,"%sfile/%04u.out",cfg.data_dir,useron.number);
MKDIR(str2);
sprintf(str2,"%sfile/%04u.out/%s",cfg.data_dir,useron.number,title);
if(fexist(str2)) {
if(fexistcase(str2)) {
bputs(text[FileAlreadyThere]);
remove(msgpath);
return(false); }
......
......@@ -295,7 +295,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
sprintf(str,"%sfile/%04u.in/%s"
,cfg.data_dir,useron.number,msg.subj);
sprintf(tmp,"%s%s",cfg.temp_dir,msg.subj);
if(fexist(str) && !fexist(tmp))
if(fexistcase(str) && !fexistcase(tmp))
mv(str,tmp,1);
}
......@@ -557,7 +557,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
lncntr=0;
unpadfname(batdn_name[i],tmp);
sprintf(tmp2,"%s%s",cfg.temp_dir,tmp);
if(!fexist(tmp2)) {
if(!fexistcase(tmp2)) {
seqwait(cfg.dir[batdn_dir[i]]->seqdev);
bprintf(text[RetrievingFile],tmp);
sprintf(str,"%s%s"
......@@ -587,17 +587,17 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
/* Copy QWK Text files */
/***********************/
sprintf(str,"%sQWK/HELLO",cfg.text_dir);
if(fexist(str)) {
if(fexistcase(str)) {
sprintf(tmp2,"%sHELLO",cfg.temp_dir);
mv(str,tmp2,1);
}
sprintf(str,"%sQWK/BBSNEWS",cfg.text_dir);
if(fexist(str)) {
if(fexistcase(str)) {
sprintf(tmp2,"%sBBSNEWS",cfg.temp_dir);
mv(str,tmp2,1);
}
sprintf(str,"%sQWK/GOODBYE",cfg.text_dir);
if(fexist(str)) {
if(fexistcase(str)) {
sprintf(tmp2,"%sGOODBYE",cfg.temp_dir);
mv(str,tmp2,1);
}
......
......@@ -1920,10 +1920,10 @@ int mv(char *src, char *dest, BOOL copy)
if(!strcmp(src,dest)) /* source and destination are the same! */
return(0);
if(!fexist(src)) {
if(!fexistcase(src)) {
logprintf("MV ERROR: Source doesn't exist '%s",src);
return(-1); }
if(!copy && fexist(dest)) {
if(!copy && fexistcase(dest)) {
logprintf("MV ERROR: Destination already exists '%s'",dest);
return(-1); }
if(!copy && ((src[1]!=':' && dest[1]!=':')
......
......@@ -371,7 +371,7 @@ void sbbs_t::extract(uint dirnum)
temp_cdt=f.cdt;
strcpy(temp_uler,f.uler);
strcpy(temp_file,f.name); } /* padded filename */
if(!fexist(path)) {
if(!fexistcase(path)) {
bputs(text[FileNotThere]); /* not on disk */
return; }
done=0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment