aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorgny Nyblom <kde@nyblom.org>2010-09-29 19:45:20 +0200
committerTorgny Nyblom <kde@nyblom.org>2010-09-29 19:45:20 +0200
commitd1737a1713da27f825682fff0e9838b559ea81a3 (patch)
tree830030512549df4761377860dcbb08b2314f25e0
parenta85ac9698a77da1cd446e7d91010ebe62cbc5f76 (diff)
downloadsvn2git-d1737a1713da27f825682fff0e9838b559ea81a3.tar
svn2git-d1737a1713da27f825682fff0e9838b559ea81a3.tar.gz
svn2git-d1737a1713da27f825682fff0e9838b559ea81a3.tar.bz2
svn2git-d1737a1713da27f825682fff0e9838b559ea81a3.tar.xz
svn2git-d1737a1713da27f825682fff0e9838b559ea81a3.zip
Die when a rule file contains an invalid regexp
-rw-r--r--src/ruleparser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp
index 5927c5a..1744969 100644
--- a/src/ruleparser.cpp
+++ b/src/ruleparser.cpp
@@ -193,6 +193,10 @@ void Rules::load()
state = ReadingMatch;
match = Match();
match.rx = QRegExp(matchLine.cap(1), Qt::CaseSensitive, QRegExp::RegExp2);
+ if( !match.rx.isValid() )
+ qFatal("Malformed regular expression '%s' in file:'%s':%d, Error: %s",
+ qPrintable(matchLine.cap(1)), qPrintable(filename), lineNumber,
+ qPrintable(match.rx.errorString()));
match.lineNumber = lineNumber;
match.filename = filename;
} else if (isVariableRule) {