Commit e27d4a8f authored by rswindell's avatar rswindell
Browse files

When adding a listfile (e.g. files.bbs), be a bit more strict:

- filenames must begin with an alpha-numeric char. Might want to relax this in
  the future if it's a problem, but generally filenames on BBSes do begin with
  alpha-numeric characters and this will help us to identify an ignore
  "garbage" filenames in listfiles.
- always check if the file actually exists, even when parsing the length of
  the file from the listfile. This will also help us to ignore garbage
  filenames.
- also removed an inexplicable unpadfname() call. Filenames in file lists
  should *not* normally be padded (like "this    .txt") - so I'm not sure why
  this was in there. Perhaps for lists generated from filelist.exe (?). Anyway,
  out of an abundance of caution, removed it. Padded filenames are going away.
parent 6f4324d9
......@@ -394,11 +394,10 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
if(p) *p=0;
else /* no space after filename? */
continue;
#if 0
strupr(fname);
#endif
SAFECOPY(fname,unpadfname(fname,tmp));
if(!isalnum(*fname)) { // filename doesn't begin with an alpha-numeric char?
continue;
}
sprintf(filepath,"%s%s",cur_altpath ? scfg.altpath[cur_altpath-1]
: scfg.dir[f.dir]->path,fname);
......@@ -499,18 +498,16 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
}
if(sskip) l=atol(fname+sskip);
else {
l=flength(filepath);
if(l<0L) {
printf("%s not found.\n",filepath);
continue;
}
if(l == 0L) {
printf("%s is a zero-0length file.\n",filepath);
continue;
}
l=flength(filepath);
if(l<0L) {
printf("%s not found.\n",filepath);
continue;
}
if(l == 0L) {
printf("%s is a zero length file.\n",filepath);
continue;
}
if(sskip) l=atol(fname+sskip);
if(mode&FILE_ID)
get_file_diz(&f, filepath);
......
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