aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@fsf.org>2018-05-11 13:21:18 -0400
committerRuben Rodriguez <ruben@fsf.org>2018-05-11 13:21:18 -0400
commite038916fe397368a7fee8ffa86dbd6c025b8d993 (patch)
treeea030bbb243247c064dfa38441470483739122e1
parent95ec8cef4c9c33ea5c4a51b86f52738932085a96 (diff)
Regexp matches at stripLicenseToRegexp should be non-global
Global matching results in alternating true/false results as explained in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test (Using test() on a regex with the global flag)
-rw-r--r--legacy_license_check.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/legacy_license_check.js b/legacy_license_check.js
index 00d341e..f783129 100644
--- a/legacy_license_check.js
+++ b/legacy_license_check.js
@@ -40,7 +40,7 @@ var stripLicenseToRegexp = function (license) {
item = license.licenseFragments[i];
item.regex = match_utils.removeNonalpha(item.text);
item.regex = new RegExp(
- match_utils.replaceTokens(item.regex), 'g');
+ match_utils.replaceTokens(item.regex), '');
}
return license;
};