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

Changed wildcard use to be more Unix-like ("*" means all files).

parent fba62c09
No related branches found
No related tags found
No related merge requests found
......@@ -214,7 +214,7 @@ char * sbbs_t::getfilespec(char *str)
bputs(text[FileSpecStarDotStar]);
if(!getstr(str,12,K_UPPER))
strcpy(str,ALLFILES);
#ifndef __unix__
#if 0
else if(!strchr(str,'.') && strlen(str)<=8)
strcat(str,".*");
#endif
......@@ -234,6 +234,8 @@ BOOL filematch(char *filename, char *filespec)
if(filespec[c]=='*') break;
else if(filespec[c]=='?') continue;
else if(toupper(filename[c])!=toupper(filespec[c])) return(FALSE);
if(filespec[8]==' ') /* no extension specified */
return(TRUE);
for(c=9;c<12;c++)
if(filespec[c]=='*') break;
else if(filespec[c]=='?') continue;
......
......@@ -532,13 +532,16 @@ char* DLLCALL padfname(char *filename, char *str)
d=c;
if(filename[c]=='.') c++;
while(d<8)
str[d++]=SP;
str[d++]='.';
str[d++]=' ';
if(filename[c]>' ') /* Change "FILE" to "FILE " */
str[d++]='.'; /* (don't add a dot if there's no extension) */
else
str[d++]=' ';
while(d<12)
if(!filename[c]) break;
else str[d++]=filename[c++];
while(d<12)
str[d++]=SP;
str[d++]=' ';
str[d]=0;
return(str);
}
......
......@@ -151,7 +151,7 @@ int sbbs_t::listfiles(uint dirnum, char *filespec, int tofile, long mode)
FREE((char *)datbuf);
return(-1); }
for(j=0;j<12 && m<l;j++)
if(j==8)
if(j==8 && ixbbuf[8]>' ')
str[j]='.';
else
str[j]=ixbbuf[m++]; /* Turns FILENAMEEXT into FILENAME.EXT */
......@@ -888,7 +888,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
found=-1;
break; }
for(i=0;i<12 && m<l;i++)
if(i==8)
if(i==8 && ixbbuf[8]>' ')
str[i]='.';
else
str[i]=ixbbuf[m++]; /* Turns FILENAMEEXT into FILENAME.EXT */
......
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