Skip to content

Commit fffb597

Browse files
mahrudd-torrance
authored andcommitted
added package name checking in needsPackage
[skip ci]
1 parent 7826f60 commit fffb597

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

M2/Macaulay2/m2/packages.m2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ loadPackage String := opts -> pkgname -> (
198198

199199
needsPackage = method(TypicalValue => Package, Options => options loadPackage)
200200
needsPackage String := opts -> pkgname -> (
201+
-- package name must be alphanumeric
202+
pkgname = checkPackageName(pkgname, true);
201203
if PackageDictionary#?pkgname
202204
and instance(pkg := value PackageDictionary#pkgname, Package)
203205
and (opts.FileName === null or

0 commit comments

Comments
 (0)