Browse Source

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

git-svn-id: trunk@21355 -
Jonas Maebe 13 years ago
parent
commit
9b21c6c84d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      utils/fpcmkcfg/fpcmkcfg.pp

+ 7 - 0
utils/fpcmkcfg/fpcmkcfg.pp

@@ -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