|
@@ -100,7 +100,7 @@ begin
|
|
|
I := 0;
|
|
|
sPath := ChangeFileExt(Result, '');
|
|
|
sExt := ExtractFileExt(Result);
|
|
|
- while FileExists(Result) do begin
|
|
|
+ while FileExists(Result) or DirectoryExists(Result) do begin
|
|
|
Inc(I);
|
|
|
Result := Format('%s(%d)%s', [sPath, I, sExt]);
|
|
|
end;
|