From 44fd9dbb4226d6d8cbdbd7fc3a010d4b82c359c4 Mon Sep 17 00:00:00 2001 From: twanvl Date: Sat, 31 May 2008 19:44:03 +0000 Subject: [PATCH] Add check to gen.pl to prevent overwriting files git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@913 0fc631ac-6414-0410-93d0-97cfa31319b6 --- tools/gen.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/gen.pl b/tools/gen.pl index 62304e46..db7472d0 100644 --- a/tools/gen.pl +++ b/tools/gen.pl @@ -22,6 +22,10 @@ $cpp =~ s@@$&\n#include <$file.hpp>@g; # write files +if (-e "../src/$file.hpp" or -e "../src/$file.cpp") { + die "The output files already exist!"; +} + open F, "> ../src/$file.hpp"; print F $hpp; close F;