summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rules/license.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/rules/license.cpp b/src/rules/license.cpp
index cc0fa8c..fe81816 100644
--- a/src/rules/license.cpp
+++ b/src/rules/license.cpp
@@ -22,6 +22,8 @@
bool afterCopyrights(false);
bool foundManaPlus(false);
+bool checkText(false);
+bool foundLicenseNumber(false);
registerRuleExt(license, "005", "(.+)[.](h|cpp)")
@@ -34,6 +36,8 @@ startRule(license)
}
afterCopyrights = false;
foundManaPlus = false;
+ checkText = false;
+ foundLicenseNumber = false;
}
endRule(license)
@@ -56,7 +60,22 @@ parseLineRule(license)
}
else if (line > 1)
{
- if (!afterCopyrights)
+ if (checkText)
+ {
+ if (data == " */")
+ {
+ if (!foundLicenseNumber)
+ print("License version not found. It must be GPL 2");
+ terminateRule();
+ }
+ else if (data == " * the Free Software Foundation;"
+ " either version 2 of the License, or")
+ {
+ foundLicenseNumber = true;
+ terminateRule();
+ }
+ }
+ else if (!afterCopyrights)
{
if (data == " *")
{
@@ -79,7 +98,7 @@ parseLineRule(license)
{
if (data != " * This file is part of The ManaPlus Client.")
print("Missing \"This file is part of The ManaPlus Client.\"");
- terminateRule();
+ checkText = true;
}
}
}