--- sbbs/src/sbbs3/scandirs.cpp 2018/04/24 16:41:23 1.1 +++ sbbs/src/sbbs3/scandirs.cpp 2018/04/24 16:43:20 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet file database scanning routines */ -/* $Id: scandirs.cpp,v 1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: scandirs.cpp,v 1.1.1.2 2018/04/24 16:43:20 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -52,25 +52,32 @@ void sbbs_t::scandirs(long mode) ch=(char)getkeys("DLA\r",0); if(sys_status&SS_ABORT || ch==CR) { lncntr=0; - return; } + return; + } if(ch!='A') { if(mode&FL_ULTIME) { /* New file scan */ - bprintf(text[NScanHdr],timestr(&ns_time)); - str[0]=0; } + bprintf(text[NScanHdr],timestr(ns_time)); + str[0]=0; + } else if(mode==FL_NO_HDR) { /* Search for a string */ if(!getfilespec(tmp)) return; - padfname(tmp,str); } + padfname(tmp,str); + } else if(mode==FL_FINDDESC) { /* Find text in description */ - if(!noyes(text[SearchExtendedQ])) + if(text[SearchExtendedQ][0] && !noyes(text[SearchExtendedQ])) mode=FL_EXFIND; if(sys_status&SS_ABORT) { lncntr=0; - return; } + return; + } bputs(text[SearchStringPrompt]); if(!getstr(str,40,K_LINE|K_UPPER)) { lncntr=0; - return; } } } + return; + } + } + } if(ch=='D') { if((s=listfiles(usrdir[curlib][curdir[curlib]],str,0,mode))==-1) return; @@ -79,7 +86,8 @@ void sbbs_t::scandirs(long mode) bprintf(text[NFilesListed],s); else if(!s && !(mode&FL_ULTIME)) bputs(text[FileNotFound]); - return; } + return; + } if(ch=='L') { k=0; for(i=0;i"); if(k>1) bprintf(text[NFilesListed],k); else if(!k && !(mode&FL_ULTIME)) bputs(text[FileNotFound]); - return; } + return; + } scanalldirs(mode); } @@ -117,22 +127,27 @@ void sbbs_t::scanalldirs(long mode) if(!usrlibs) return; k=0; if(mode&FL_ULTIME) { /* New file scan */ - bprintf(text[NScanHdr],timestr(&ns_time)); - str[0]=0; } + bprintf(text[NScanHdr],timestr(ns_time)); + str[0]=0; + } else if(mode==FL_NO_HDR) { /* Search for a string */ if(!getfilespec(tmp)) return; - padfname(tmp,str); } + padfname(tmp,str); + } else if(mode==FL_FINDDESC) { /* Find text in description */ - if(!noyes(text[SearchExtendedQ])) + if(text[SearchExtendedQ][0] && !noyes(text[SearchExtendedQ])) mode=FL_EXFIND; if(sys_status&SS_ABORT) { lncntr=0; - return; } + return; + } bputs(text[SearchStringPrompt]); if(!getstr(str,40,K_LINE|K_UPPER)) { lncntr=0; - return; } } + return; + } + } for(i=d=0;i"); if(k>1) bprintf(text[NFilesListed],k);