* abort if the specified destination file is a directory (mantis #22089)

git-svn-id: trunk@21355 -
This commit is contained in:
Jonas Maebe 2012-05-21 11:37:41 +00:00
parent 9bfb8b5d48
commit 9b21c6c84d

View File

@ -79,6 +79,7 @@ Resourcestring
SErrBackupFailed = 'Error: Backup of file "%s" to "%s" failed.';
SErrDelBackupFailed = 'Error: Delete of old backup file "%s" failed.';
SErrCreateDirFailed = 'Error: Could not create the directory for file "%s".';
SErrDestDirectory = 'Error: The output file "%s" is a directory.';
SWarnIgnoringFile = 'Warning: Ignoring non-existent file: ';
SWarnIgnoringPair = 'Warning: Ignoring wrong name/value pair: ';
@ -490,6 +491,12 @@ Var
I : Integer;
begin
if (OutputFileName<>'') and
DirectoryExists(OutputFileName) then
begin
Writeln(StdErr,Format(SErrDestDirectory,[OutputFileName]));
Halt(1);
end;
If (OutputFileName<>'')
and FileExists(OutputFileName)
and not SkipBackup then