summaryrefslogtreecommitdiffstats
path: root/Source/cmRegularExpression.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-11-06 21:59:09 (GMT)
committerBrad King <brad.king@kitware.com>2002-11-06 21:59:09 (GMT)
commit5417d02a61dfaed3377a017b2ffeaea66f8344ce (patch)
treebbc5a60a825884080f2d9798d1e646f7e2a60c39 /Source/cmRegularExpression.cxx
parent0930c14b0415b5c2503c8713e9bbac19e6fb0d4b (diff)
downloadCMake-5417d02a61dfaed3377a017b2ffeaea66f8344ce.zip
CMake-5417d02a61dfaed3377a017b2ffeaea66f8344ce.tar.gz
CMake-5417d02a61dfaed3377a017b2ffeaea66f8344ce.tar.bz2
ENH: compile method now returns whether compilation succeeded.
Diffstat (limited to 'Source/cmRegularExpression.cxx')
-rw-r--r--Source/cmRegularExpression.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmRegularExpression.cxx b/Source/cmRegularExpression.cxx
index b8fd823..ce7b57a 100644
--- a/Source/cmRegularExpression.cxx
+++ b/Source/cmRegularExpression.cxx
@@ -300,7 +300,7 @@ static int strcspn ();
// compile -- compile a regular expression into internal code
// for later pattern matching.
-void cmRegularExpression::compile (const char* exp) {
+bool cmRegularExpression::compile (const char* exp) {
register const char* scan;
register const char* longest;
register unsigned long len;
@@ -309,7 +309,7 @@ void cmRegularExpression::compile (const char* exp) {
if (exp == 0) {
//RAISE Error, SYM(cmRegularExpression), SYM(No_Expr),
printf ("cmRegularExpression::compile(): No expression supplied.\n");
- return;
+ return false;
}
// First pass: determine size, legality.
@@ -321,7 +321,7 @@ void cmRegularExpression::compile (const char* exp) {
if(!reg(0, &flags))
{
printf ("cmRegularExpression::compile(): Error in compile.\n");
- return;
+ return false;
}
this->startp[0] = this->endp[0] = this->searchstring = 0;
@@ -329,7 +329,7 @@ void cmRegularExpression::compile (const char* exp) {
if (regsize >= 32767L) { // Probably could be 65535L.
//RAISE Error, SYM(cmRegularExpression), SYM(Expr_Too_Big),
printf ("cmRegularExpression::compile(): Expression too big.\n");
- return;
+ return false;
}
// Allocate space.
@@ -342,7 +342,7 @@ void cmRegularExpression::compile (const char* exp) {
if (this->program == 0) {
//RAISE Error, SYM(cmRegularExpression), SYM(Out_Of_Memory),
printf ("cmRegularExpression::compile(): Out of memory.\n");
- return;
+ return false;
}
// Second pass: emit code.
@@ -387,6 +387,7 @@ void cmRegularExpression::compile (const char* exp) {
this->regmlen = len;
}
}
+ return true;
}