Prefer SysUtils.IncludeTrailingPathDelimiter over home brown code

This commit is contained in:
Ansgar Becker
2012-11-10 14:43:35 +00:00
parent ca1d94c87b
commit a6170ad769
2 changed files with 2 additions and 6 deletions

View File

@ -6399,8 +6399,7 @@ begin
if Value then begin
// Ensure directory exists
LogDir := AppSettings.ReadString(asSessionLogsDirectory);
if LogDir[Length(LogDir)] <> '\' then
LogDir := LogDir + '\';
LogDir := IncludeTrailingPathDelimiter(LogDir);
ForceDirectories(LogDir);
// Determine free filename

View File

@ -1177,10 +1177,7 @@ begin
ExportStreamStartOfQueryPos := 0;
if ToDir then begin
FreeAndNil(ExportStream);
DbDir := comboExportOutputTarget.Text;
if DbDir[Length(DbDir)] <> '\' then
DbDir := DbDir + '\';
DbDir := DbDir + DBObj.Database + '\';
DbDir := IncludeTrailingPathDelimiter(comboExportOutputTarget.Text) + DBObj.Database + '\';
if not DirectoryExists(DbDir) then
ForceDirectories(DbDir);
ExportStream := TFileStream.Create(DbDir + DBObj.Name+'.sql', fmCreate or fmOpenWrite);