summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 7c9a155..3b29bf5 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -185,8 +185,14 @@ int do_cmake(int ac, char** av)
}
else if (strncmp(av[i], "-P", strlen("-P")) == 0)
{
+ if ( i == ac -1 )
+ {
+ cmSystemTools::Error("No script specified for argument -P");
+ }
script_mode = true;
args.push_back(av[i]);
+ i++;
+ args.push_back(av[i]);
}
else
{