Skip to content
Snippets Groups Projects
Commit fee120db authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use the liberal file matching to continue file listing/searches

If the user didn't supply a wildcard, only a single file (the first file
matching the liberal file pattern) would ever be listed in the file
listing/searches, even when multiple files in the directory matched the
liberal file matching pattern. This is not a new bug.
parent b7aaac27
No related branches found
No related tags found
No related merge requests found
Pipeline #6621 passed
...@@ -71,9 +71,10 @@ int sbbs_t::listfiles(const int dirnum, const char *filespec, FILE* tofile, cons ...@@ -71,9 +71,10 @@ int sbbs_t::listfiles(const int dirnum, const char *filespec, FILE* tofile, cons
if(smb_open_dir(&cfg, &smb, dirnum) != SMB_SUCCESS) if(smb_open_dir(&cfg, &smb, dirnum) != SMB_SUCCESS)
return 0; return 0;
filespec = liberal_filepattern(filespec, filepattern, sizeof filepattern);
size_t file_count = 0; size_t file_count = 0;
file_t* file_list = loadfiles(&smb file_t* file_list = loadfiles(&smb
, (mode & FL_FIND) ? NULL : liberal_filepattern(filespec, filepattern, sizeof filepattern) , (mode & FL_FIND) ? NULL : filespec
, (mode & FL_ULTIME) ? ns_time : 0 , (mode & FL_ULTIME) ? ns_time : 0
, tofile == NULL ? file_detail_extdesc : file_detail_normal , tofile == NULL ? file_detail_extdesc : file_detail_normal
, (enum file_sort)cfg.dir[dirnum]->sort , (enum file_sort)cfg.dir[dirnum]->sort
...@@ -740,6 +741,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, uint* row, const int total ...@@ -740,6 +741,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, uint* row, const int total
int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode) int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
{ {
char str[MAX_PATH + 1],path[MAX_PATH + 1],dirpath[MAX_PATH + 1],done=0,ch; char str[MAX_PATH + 1],path[MAX_PATH + 1],dirpath[MAX_PATH + 1],done=0,ch;
char filepattern[SMB_FILEIDX_NAMELEN + 1] = "";
char tmp[512]; char tmp[512];
int error; int error;
int found=0; int found=0;
...@@ -765,9 +767,10 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode) ...@@ -765,9 +767,10 @@ int sbbs_t::listfileinfo(const int dirnum, const char *filespec, const int mode)
if(smb_open_dir(&cfg, &smb, dirnum) != SMB_SUCCESS) if(smb_open_dir(&cfg, &smb, dirnum) != SMB_SUCCESS)
return 0; return 0;
filespec = liberal_filepattern(filespec, filepattern, sizeof filepattern);
size_t file_count = 0; size_t file_count = 0;
file_t* file_list = loadfiles(&smb file_t* file_list = loadfiles(&smb
, liberal_filepattern(filespec, str, sizeof str) , filespec
, /* time_t */0 , /* time_t */0
, file_detail_extdesc , file_detail_extdesc
, (enum file_sort)cfg.dir[dirnum]->sort , (enum file_sort)cfg.dir[dirnum]->sort
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment