Skip to content

Commit

Permalink
Encode if we have readline in workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Aug 21, 2018
1 parent 470fbe0 commit f42a0fd
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/saveload.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,26 @@ static void RemoveSaveIndex( Bag bag)
LINK_BAG(bag) = bag;
}



static Char * GetKernelDescription( void )
{
static Char SyKernelDescription[256];
strcpy(SyKernelDescription, SyKernelVersion);
if(SyUseReadline)
{
strcat(SyKernelDescription, " with readline");
}
return SyKernelDescription;
}

static void WriteSaveHeader( void )
{
UInt i;
UInt globalcount = 0;

SaveCStr("GAP workspace");
SaveCStr(SyKernelVersion);
SaveCStr(GetKernelDescription());

#ifdef SYS_IS_64_BIT
SaveCStr("64 bit");
Expand Down Expand Up @@ -661,9 +674,9 @@ void LoadWorkspace( Char * fname )
if (strcmp (buf, "GAP workspace") == 0) {

LoadCStr(buf,256);
if (strcmp (buf, SyKernelVersion) != 0) {
if (strcmp (buf, GetKernelDescription()) != 0) {
Pr("This workspace is not compatible with GAP kernel (%s, present: %s).\n",
(long)buf, (long)SyKernelVersion);
(long)buf, (long)GetKernelDescription());
SyExit(1);
}

Expand Down

0 comments on commit f42a0fd

Please sign in to comment.