mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-31 15:26:04 +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.';
|
SErrBackupFailed = 'Error: Backup of file "%s" to "%s" failed.';
|
||||||
SErrDelBackupFailed = 'Error: Delete of old backup file "%s" failed.';
|
SErrDelBackupFailed = 'Error: Delete of old backup file "%s" failed.';
|
||||||
SErrCreateDirFailed = 'Error: Could not create the directory for file "%s".';
|
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: ';
|
SWarnIgnoringFile = 'Warning: Ignoring non-existent file: ';
|
||||||
SWarnIgnoringPair = 'Warning: Ignoring wrong name/value pair: ';
|
SWarnIgnoringPair = 'Warning: Ignoring wrong name/value pair: ';
|
||||||
@ -490,6 +491,12 @@ Var
|
|||||||
I : Integer;
|
I : Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
if (OutputFileName<>'') and
|
||||||
|
DirectoryExists(OutputFileName) then
|
||||||
|
begin
|
||||||
|
Writeln(StdErr,Format(SErrDestDirectory,[OutputFileName]));
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
If (OutputFileName<>'')
|
If (OutputFileName<>'')
|
||||||
and FileExists(OutputFileName)
|
and FileExists(OutputFileName)
|
||||||
and not SkipBackup then
|
and not SkipBackup then
|
||||||
|
Loading…
Reference in New Issue
Block a user