fix: *.diff.tpl

This commit is contained in:
Massimo Melina 2020-05-21 19:47:37 +02:00
parent 2e6bd51e00
commit 6367b5675d
3 changed files with 18 additions and 23 deletions

View File

@ -2815,15 +2815,14 @@ result:=(filesStayFlaggedForMinutes > 0)
and (trunc(abs(now()-t)*24*60) <= filesStayFlaggedForMinutes)
end; // isNew
function getFiles(mask:string):TstringList;
function getFiles(mask:string):TStringDynArray;
var
sr: TSearchRec;
begin
result:=TstringList.create;
result.CaseSensitive:=FALSE;
if findFirst(exePath+'*.diff.tpl', faAnyFile, sr) = 0 then
result:=NIL;
if findFirst(mask, faAnyFile, sr) = 0 then
try
repeat result.add(sr.name)
repeat addString(sr.name, result)
until findNext(sr) <> 0;
finally findClose(sr) end;
end; // getFiles
@ -2845,20 +2844,6 @@ var
result:=TRUE;
end; // add2diff
procedure loadStar();
var
list: TstringList;
s: string;
begin
list:=getFiles(exePath+'hfs.diff.*.tpl');
try
list.sort();
for s in list do
add2diff(s);
finally list.free
end;
end;
begin
result:='';
diff:='';
@ -2904,7 +2889,8 @@ while assigned(f) do
f:=f.parent;
first:=FALSE;
end;
loadStar();
for s in sortArray(getFiles(exePath+'*.diff.tpl')) do
add2diff(loadTextFile(s));
result:=diff;
end; // getRecursiveDiffTplAsStr

View File

@ -1,7 +1,15 @@
+ expiring links
* dismiss regexp lib http://docwiki.embarcadero.com/Libraries/Rio/en/System.RegularExpressions.TRegEx
+ ipv6
+ load *.events
+ url auth limited to resource
+ global limit speed for downloads (browsing excluded)
+ [tpl id] [SECTION|for-tpl=MASK]
* consider letting comment "protected" files. Can it really cause harm?
* flag to enable lnk files in a folder (disabled by default)
+ sign exe http://www.rejetto.com/forum/hfs-~-http-file-server/'unsafe'/msg1061437/#msg1061437
cache reReplace
* cache reReplace
+ {.calc.} to have a third numeric parameter that becomes 'x' symbol
+ hash&salt passwords
- setInterval > setTimeout
+ target=_blank as an option on links

View File

@ -178,7 +178,7 @@ function idxOf(s:string; a:array of string; isSorted:boolean=FALSE):integer;
function stringExists(s:string; a:array of string; isSorted:boolean=FALSE):boolean;
function listToArray(l:Tstrings):TstringDynArray;
function arrayToList(a:TStringDynArray; list:TstringList=NIL):TstringList;
procedure sortArray(var a:TStringDynArray);
function sortArray(a:TStringDynArray):TStringDynArray;
// convert
function boolToPtr(b:boolean):pointer;
function strToCharset(s:string):Tcharset;
@ -2639,7 +2639,7 @@ accounts[i]:=acc;
result:=@accounts[i];
end; // createAccountOnTheFly
procedure sortArray(var a:TStringDynArray);
function sortArray(a:TStringDynArray):TStringDynArray;
var
i, j, l: integer;
begin
@ -2647,6 +2647,7 @@ l:=length(a);
for i:=0 to l-2 do
for j:=i+1 to l-1 do
swapMem(a[i], a[j], sizeof(a[i]), ansiCompareText(a[i], a[j]) > 0);
result:=a;
end; // sortArray
procedure onlyForExperts(controls:array of Tcontrol);