mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-02 06:02:41 +02:00
* abort if the specified destination file is a directory (mantis #22089)
git-svn-id: trunk@21355 -
This commit is contained in:
parent
9bfb8b5d48
commit
9b21c6c84d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user