Skip to content

Commit 90820b6

Browse files
authored
Make LogPackageLoadingMessage argument check more strict (gap-system#6093)
1 parent d021536 commit 90820b6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/package.gi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,13 @@ if not IsBound( TextAttr ) then
615615
fi;
616616
#T needed? (decl. of GAPDoc is loaded before)
617617

618-
InstallGlobalFunction( LogPackageLoadingMessage, function( arg )
619-
local severity, message, currpkg, i;
618+
InstallGlobalFunction( LogPackageLoadingMessage, function( severity, message, currpkg... )
619+
local i;
620620

621-
severity:= arg[1];
622-
message:= arg[2];
623-
if Length( arg ) = 3 then
624-
currpkg:= arg[3];
621+
if Length( currpkg ) = 1 then
622+
currpkg:= currpkg[1];
623+
elif Length( currpkg ) > 1 then
624+
Error("usage: LogPackageLoadingMessage( <severity>, <message>[, <name>] )");
625625
elif IsBound( GAPInfo.PackageCurrent ) then
626626
# This happens inside availability tests.
627627
currpkg:= GAPInfo.PackageCurrent.PackageName;

0 commit comments

Comments
 (0)