Commit b3095bdb authored by rswindell's avatar rswindell
Browse files

Fixed more filename case sensitivity problems.

parent 350970e6
......@@ -39,7 +39,6 @@
#define ADDFILES_VER "3.00"
char tmp[256];
extern char *crlf;
scfg_t scfg;
......@@ -66,7 +65,7 @@ long files=0,removed=0,mode=0;
long lputs(char FAR16 *str)
{
char tmp[256];
char tmp[512];
int i,j,k;
j=strlen(str);
......@@ -86,7 +85,7 @@ long lputs(char FAR16 *str)
int lprintf(char *fmat, ...)
{
va_list argptr;
char sbuf[256];
char sbuf[512];
int chcount;
va_start(argptr,fmat);
......@@ -176,7 +175,7 @@ void updatestats(ulong size)
int file;
ulong l;
sprintf(str,"%sDSTS.DAB",scfg.ctrl_dir);
sprintf(str,"%sdsts.dab",scfg.ctrl_dir);
if((file=nopen(str,O_RDWR))==-1) {
printf("ERR_OPEN %s\n",str);
return;
......@@ -195,10 +194,16 @@ void updatestats(ulong size)
void addlist(char *inpath, file_t f, uint dskip, uint sskip)
{
uchar str[256],fname[256],listpath[256],filepath[256]
,curline[256],nextline[256],*p,exist,ext[1024],tmpext[513];
char str[MAX_PATH+1];
char tmp[MAX_PATH+1];
char fname[MAX_PATH+1];
char listpath[MAX_PATH+1];
char filepath[MAX_PATH+1];
char curline[256],nextline[256];
uchar *p,ext[1024],tmpext[513];
int i,file;
long l;
BOOL exist;
FILE *stream;
DIR* dir;
DIRENT* dirent;
......@@ -303,6 +308,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
strcpy(listpath,inpath);
fexistcase(listpath);
if((stream=fnopen(&file,listpath,O_RDONLY))==NULL) {
sprintf(listpath,"%s%s",cur_altpath ? scfg.altpath[cur_altpath-1]
: scfg.dir[f.dir]->path,inpath);
......@@ -483,13 +489,17 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
void synclist(char *inpath, int dirnum)
{
uchar str[1024],fname[256],listpath[256], HUGE16 *ixbbuf,*p;
int i,file,found;
long l,m,length;
FILE *stream;
file_t f;
uchar str[1024];
char fname[MAX_PATH+1];
char listpath[MAX_PATH+1];
uchar* ixbbuf;
uchar* p;
int i,file,found;
long l,m,length;
FILE* stream;
file_t f;
sprintf(str,"%s%s.IXB",scfg.dir[dirnum]->data_dir,scfg.dir[dirnum]->code);
sprintf(str,"%s%s.ixb",scfg.dir[dirnum]->data_dir,scfg.dir[dirnum]->code);
if((file=nopen(str,O_RDONLY))==-1) {
printf("ERR_OPEN %s\n",str);
return; }
......@@ -596,15 +606,17 @@ int main(int argc, char **argv)
{
char error[512];
char revision[16];
uchar str[256],*p,exist,listgiven=0,namegiven=0,ext[513]
,auto_name[13]="FILES.BBS";
char str[MAX_PATH+1];
char tmp[MAX_PATH+1];
uchar *p,exist,listgiven=0,namegiven=0,ext[513]
,auto_name[MAX_PATH+1]="FILES.BBS";
int i,j,file;
long l;
file_t f;
sscanf("$Revision$" + 11, "%s", revision);
fprintf(stderr,"\nADDFILES v%s-%s (rev %s) - Adds files to Synchronet "
fprintf(stderr,"\nADDFILES v%s-%s (rev %s) - Adds Files to Synchronet "
"Filebase\n"
,ADDFILES_VER
,PLATFORM_DESC
......@@ -635,7 +647,7 @@ int main(int argc, char **argv)
if(argv[1][0]=='*') {
if(argv[1][1])
sprintf(auto_name,"%.12s",argv[1]+1);
SAFECOPY(auto_name,argv[1]+1);
mode|=AUTO_ADD;
i=0; }
else {
......@@ -802,15 +814,15 @@ int main(int argc, char **argv)
if(mode&SEARCH_DIR) {
addlist("",f,0,0);
continue; }
sprintf(str,"%s.LST",scfg.dir[f.dir]->code);
if(flength(str)>0L) {
sprintf(str,"%s.lst",scfg.dir[f.dir]->code);
if(fexistcase(str) && flength(str)>0L) {
printf("Auto-adding %s\n",str);
addlist(str,f,0,0);
if(mode&SYNC_LIST)
synclist(str,i);
continue; }
sprintf(str,"%s%s",scfg.dir[f.dir]->path,auto_name);
if(flength(str)>0L) {
if(fexistcase(str) && flength(str)>0L) {
printf("Auto-adding %s\n",str);
addlist(str,f,0,0);
if(mode&SYNC_LIST)
......@@ -819,8 +831,8 @@ int main(int argc, char **argv)
else {
if(!listgiven && !namegiven) {
sprintf(str,"%s.LST",scfg.dir[f.dir]->code);
if(flength(str)<=0L)
sprintf(str,"%s.lst",scfg.dir[f.dir]->code);
if(!fexistcase(str) || flength(str)<=0L)
strcpy(str,"FILES.BBS");
addlist(str,f,0,0);
if(mode&SYNC_LIST)
......
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